From 149921299dd5a0e480a802a23abd0ee9b42a1f29 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Mon, 21 May 2018 22:29:07 -0500 Subject: 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. --- lib/ephy-string.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/ephy-string.c') 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); -- cgit v1.2.1