From: Mark Adler Date: Sun, 1 Jan 2017 20:23:04 +0000 (-0800) Subject: Avoid warnings on snprintf() return value. X-Git-Tag: 1.9.9-b1~707 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61a36de691b5e61bf942f8872cb9d4e68683fce6;p=thirdparty%2Fzlib-ng.git Avoid warnings on snprintf() return value. --- diff --git a/gzlib.c b/gzlib.c index 04217db56..688902aa6 100644 --- a/gzlib.c +++ b/gzlib.c @@ -153,7 +153,7 @@ static gzFile gz_open(const void *path, int fd, const char *mode) { } else #endif - snprintf(state->path, len + 1, "%s", (const char *)path); + (void)snprintf(state->path, len + 1, "%s", (const char *)path); /* compute the flags for open() */ oflag = @@ -224,7 +224,7 @@ gzFile ZEXPORT gzdopen(int fd, const char *mode) { if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) return NULL; - snprintf(path, 7 + 3 * sizeof(int), "", fd); /* for debugging */ + (void)snprintf(path, 7 + 3 * sizeof(int), "", fd); /* for debugging */ gz = gz_open(path, fd, mode); free(path); return gz; @@ -495,7 +495,7 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { state->err = Z_MEM_ERROR; return; } - snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, "%s%s%s", state->path, ": ", msg); + (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, "%s%s%s", state->path, ": ", msg); } #ifndef INT_MAX