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 /ui/text_import.c | |
parent | 09147397007c5456fd5acd4794b5ba15330bdad3 (diff) | |
download | wireshark-57a1514ac74527651ad42dca3041f3f53509317e.tar.gz wireshark-57a1514ac74527651ad42dca3041f3f53509317e.tar.bz2 wireshark-57a1514ac74527651ad42dca3041f3f53509317e.zip |
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 'ui/text_import.c')
-rw-r--r-- | ui/text_import.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/text_import.c b/ui/text_import.c index e3b7bb139a..ab31ce9387 100644 --- a/ui/text_import.c +++ b/ui/text_import.c @@ -669,12 +669,12 @@ append_to_preamble(char *str) if (toklen != 0) { if (packet_preamble_len + toklen > PACKET_PREAMBLE_MAX_LEN) return; /* no room to add the token to the preamble */ - g_strlcpy(&packet_preamble[packet_preamble_len], str, PACKET_PREAMBLE_MAX_LEN); + (void) g_strlcpy(&packet_preamble[packet_preamble_len], str, PACKET_PREAMBLE_MAX_LEN); packet_preamble_len += (int) toklen; if (debug >= 2) { char *c; char xs[PACKET_PREAMBLE_MAX_LEN]; - g_strlcpy(xs, packet_preamble, PACKET_PREAMBLE_MAX_LEN); + (void) g_strlcpy(xs, packet_preamble, PACKET_PREAMBLE_MAX_LEN); while ((c = strchr(xs, '\r')) != NULL) *c=' '; fprintf (stderr, "[[append_to_preamble: \"%s\"]]", xs); } @@ -941,8 +941,8 @@ static void _parse_time(const guchar* start_field, const guchar* end_field, cons char *p; int i; - g_strlcpy(field, start_field, MIN(end_field - start_field + 1, PARSE_BUF)); - g_strlcpy(format, _format, PARSE_BUF); + (void) g_strlcpy(field, start_field, MIN(end_field - start_field + 1, PARSE_BUF)); + (void) g_strlcpy(format, _format, PARSE_BUF); /* * Initialize to today localtime, just in case not all fields @@ -1017,7 +1017,7 @@ void parse_time(const guchar* start_field, const guchar* end_field, const gchar* void parse_seqno(const guchar* start_field, const guchar* end_field) { char* buf = (char*) g_alloca(end_field - start_field + 1); - g_strlcpy(buf, start_field, end_field - start_field + 1); + (void) g_strlcpy(buf, start_field, end_field - start_field + 1); seqno = g_ascii_strtoull(buf, NULL, 10); } |