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 2adcb7be71
commit 0ef91c3ba8

View File

@ -164,7 +164,7 @@ languages_parse_start_tag (GMarkupParseContext *ctx,
for (i = 0; i < G_N_ELEMENTS (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';
}