diff options
author | Pablo Barciela <[email protected]> | 2019-02-23 15:47:55 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2019-03-04 12:51:15 +0100 |
commit | 4f4d31f905b2073cc39f2f214bcd9ba64f8ee61f (patch) | |
tree | 8eece05440c74720a40b43618522d9c66fa2c3d2 /eel | |
parent | ad07330e1a39bc4469aa9c085a34750f8c505266 (diff) | |
download | caja-4f4d31f905b2073cc39f2f214bcd9ba64f8ee61f.tar.bz2 caja-4f4d31f905b2073cc39f2f214bcd9ba64f8ee61f.tar.xz |
[Security] eel-string: Use 'g_strlcat' instead of 'strcat'
to avoid warnings with Clang Analyzer
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-string.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eel/eel-string.c b/eel/eel-string.c index 64bca4fa..aea801ea 100644 --- a/eel/eel-string.c +++ b/eel/eel-string.c @@ -246,8 +246,8 @@ eel_str_middle_truncate (const char *string, truncated = g_new (char, strlen (string) + 1); g_utf8_strncpy (truncated, string, num_left_chars); - strcat (truncated, delimter); - strcat (truncated, g_utf8_offset_to_pointer (string, length - num_right_chars)); + g_strlcat (truncated, delimter, (truncate_length + 1)); + g_strlcat (truncated, g_utf8_offset_to_pointer (string, length - num_right_chars), (truncate_length + 1)); return truncated; } |