]> git.lizzy.rs Git - zlib.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)
committerMark Adler <madler@alumni.caltech.edu>
Mon, 2 Jan 2017 06:24:37 +0000 (22:24 -0800)
gzlib.c

diff --git a/gzlib.c b/gzlib.c
index a87d3d19ecd439108c1e2aae41c542338fdd4e64..e142ffb3d75c6219af15a5aec167b3b99fd6d15d 100644 (file)
--- a/gzlib.c
+++ b/gzlib.c
@@ -211,7 +211,7 @@ local gzFile gz_open(path, fd, mode)
     else
 #endif
 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
-        snprintf(state->path, len + 1, "%s", (const char *)path);
+        (void)snprintf(state->path, len + 1, "%s", (const char *)path);
 #else
         strcpy(state->path, path);
 #endif
@@ -293,7 +293,7 @@ gzFile ZEXPORT gzdopen(fd, mode)
     if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
         return NULL;
 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
-    snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
+    (void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
 #else
     sprintf(path, "<fd:%d>", fd);   /* for debugging */
 #endif
@@ -608,8 +608,8 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
         return;
     }
 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
-    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);
 #else
     strcpy(state->msg, state->path);
     strcat(state->msg, ": ");