diff options
author | Michael Catanzaro <mcatanzaro@igalia.com> | 2018-05-21 22:29:07 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2018-05-21 22:29:07 -0500 |
commit | 149921299dd5a0e480a802a23abd0ee9b42a1f29 (patch) | |
tree | 6ca3b28517626c661f584cae15fe04339058b0da /lib/ephy-string.c | |
parent | e498ee9674475f47409dd9a3398736ff0fc44bd9 (diff) | |
download | epiphany-149921299dd5a0e480a802a23abd0ee9b42a1f29.tar.gz |
Silence -Wstring-op-truncation warning
It's a false positive, because we add the NUL on the next line, but
better to just fix the strncpy.
Diffstat (limited to 'lib/ephy-string.c')
-rw-r--r-- | lib/ephy-string.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ephy-string.c b/lib/ephy-string.c index a1ea6d453..2bd71a973 100644 --- a/lib/ephy-string.c +++ b/lib/ephy-string.c @@ -119,8 +119,7 @@ ephy_string_shorten (char *str, new_str = g_new (gchar, bytes + strlen (ELLIPSIS) + 1); strncpy (new_str, str, bytes); - strncpy (new_str + bytes, ELLIPSIS, strlen (ELLIPSIS)); - new_str[bytes + strlen (ELLIPSIS)] = '\0'; + strncpy (new_str + bytes, ELLIPSIS, strlen (ELLIPSIS) + 1); g_free (str); |