diff options
author | Guy Harris <gharris@sonic.net> | 2021-04-30 03:18:25 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-04-30 03:19:19 -0700 |
commit | 57a1514ac74527651ad42dca3041f3f53509317e (patch) | |
tree | a69a01eaeac3d625a5312930fa81f0a3c6b12e96 /wsutil | |
parent | 09147397007c5456fd5acd4794b5ba15330bdad3 (diff) |
Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation. Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/filesystem.c | 4 | ||||
-rw-r--r-- | wsutil/inet_addr.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 726e8d8467..33a14e0ac3 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -632,8 +632,8 @@ init_progfile_dir( path = (char *)g_malloc(path_len); memcpy(path, path_start, path_component_len); path[path_component_len] = '\0'; - g_strlcat(path, "/", path_len); - g_strlcat(path, execname, path_len); + (void) g_strlcat(path, "/", path_len); + (void) g_strlcat(path, execname, path_len); if (access(path, X_OK) == 0) { /* * Found it! diff --git a/wsutil/inet_addr.c b/wsutil/inet_addr.c index e4893d07bd..61f5f7f82f 100644 --- a/wsutil/inet_addr.c +++ b/wsutil/inet_addr.c @@ -80,7 +80,7 @@ _inet_ntop(int af, gconstpointer src, gchar *dst, guint dst_size) break; } /* set result to something that can't be confused with a valid conversion */ - g_strlcpy(dst, errmsg, dst_size); + (void) g_strlcpy(dst, errmsg, dst_size); /* set errno for caller */ errno = saved_errno; } |