diff options
author | Andreas Schneider <asn@samba.org> | 2018-03-21 12:49:38 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2018-04-03 20:20:10 +0200 |
commit | bc3834d6910c71159ee5e6dc3b04475706d9e846 (patch) | |
tree | 70e2098398366f32c3c0746b0d0e3972bf091837 /lib/util | |
parent | 41895045bae5f71e964d767ce676172cc1e6768c (diff) | |
download | samba-bc3834d6910c71159ee5e6dc3b04475706d9e846.tar.gz |
lib:util: Fix size types in fgets_slash()
This fixes compilation with -Wstrict-overflow=2.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/samba_util.h | 2 | ||||
-rw-r--r-- | lib/util/util_file.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index b78252316c8..7b96a595d43 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -352,7 +352,7 @@ const char **str_list_make_v3_const(TALLOC_CTX *mem_ctx, */ _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint); -char *fgets_slash(TALLOC_CTX *mem_ctx, char *s2, int maxlen, FILE *f); +char *fgets_slash(TALLOC_CTX *mem_ctx, char *s2, size_t maxlen, FILE *f); /** load a file into memory from a fd. diff --git a/lib/util/util_file.c b/lib/util/util_file.c index 499e8c46693..bf2f3e1a27f 100644 --- a/lib/util/util_file.c +++ b/lib/util/util_file.c @@ -79,10 +79,10 @@ _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint) return data; } -char *fgets_slash(TALLOC_CTX *mem_ctx, char *s2, int maxlen, FILE *f) +char *fgets_slash(TALLOC_CTX *mem_ctx, char *s2, size_t maxlen, FILE *f) { char *s = s2; - int len = 0; + size_t len = 0; int c; bool start_of_line = true; |