]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Avoid warnings on snprintf() return value.
authorMark Adler <madler@alumni.caltech.edu>
Sun, 1 Jan 2017 20:23:04 +0000 (12:23 -0800)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 9 Feb 2017 10:49:52 +0000 (11:49 +0100)
gzlib.c

diff --git a/gzlib.c b/gzlib.c
index 04217db562a2e5597c64a85d099d22bd66672c8e..688902aa6e0568ba966aa3da8d2b5f64964fed17 100644 (file)
--- 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:%d>", fd); /* for debugging */
+    (void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", 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