Fixed strdup without size in convert_utf8

This commit is contained in:
Jesse van den Kieboom 2009-01-30 22:02:37 +01:00
parent 926c8e0b81
commit dde703c8a9

View File

@ -191,7 +191,7 @@ gitg_utils_convert_utf8(gchar const *str, gssize size)
};
if (g_utf8_validate(str, size, NULL))
return g_strdup(str);
return g_strndup(str, size);
int i;
for (i = 0; i < sizeof(encodings) / sizeof(gchar *); ++i)