Avoid a buffer overrun

We were putting the '\0' behind the end. Oops.
This commit is contained in:
Matthias Clasen 2021-01-22 13:56:04 -05:00
parent 90ef388641
commit 100de32cff

View File

@ -164,7 +164,7 @@ languages_parse_start_tag (GMarkupParseContext *ctx,
for (i = 0; i < G_N_ELEMENTS (long_names); i++) for (i = 0; i < G_N_ELEMENTS (long_names); i++)
{ {
if (g_str_has_prefix (display_name, long_names[i])) if (g_str_has_prefix (display_name, long_names[i]))
display_name[strlen (long_names[i]) + 1] = '\0'; display_name[strlen (long_names[i])] = '\0';
} }