fix bogus use of g_strlcpy

Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
This commit is contained in:
Simon Budig 2014-08-15 23:08:42 +02:00
parent 56fa168ec3
commit e0e29889b0
1 changed files with 9 additions and 5 deletions

View File

@ -116,11 +116,15 @@ gimp_brush_generated_load (GimpContext *context,
/* the empty string is not an allowed name */
if (strlen (string) < 1)
g_strlcpy (string, _("Untitled"), sizeof (string));
name = gimp_any_to_utf8 (string, -1,
_("Invalid UTF-8 string in brush file '%s'."),
gimp_file_get_utf8_name (file));
{
name = g_strdup (_("Untitled"));
}
else
{
name = gimp_any_to_utf8 (string, -1,
_("Invalid UTF-8 string in brush file '%s'."),
gimp_file_get_utf8_name (file));
}
g_free (string);