don't call strlen on a NULL font name.
2007-07-20 Sven Neumann <sven@gimp.org> * app/text/gimptext.c (gimp_text_set_property): don't call strlen on a NULL font name. svn path=/trunk/; revision=22968
This commit is contained in:

committed by
Sven Neumann

parent
e2b9c20b43
commit
46eb9b2f90
@ -1,3 +1,8 @@
|
||||
2007-07-20 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/text/gimptext.c (gimp_text_set_property): don't call strlen
|
||||
on a NULL font name.
|
||||
|
||||
2007-07-20 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/tools/gimprectangletool.c: fixed a gtk-doc comment.
|
||||
|
@ -364,14 +364,23 @@ gimp_text_set_property (GObject *object,
|
||||
case PROP_FONT:
|
||||
{
|
||||
const gchar *font = g_value_get_string (value);
|
||||
|
||||
g_free (text->font);
|
||||
|
||||
if (font)
|
||||
{
|
||||
gsize len = strlen (font);
|
||||
|
||||
if (g_str_has_suffix (font, " Not-Rotated"))
|
||||
len -= strlen ( " Not-Rotated");
|
||||
|
||||
g_free (text->font);
|
||||
text->font = g_strndup (font, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
text->font = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROP_FONT_SIZE:
|
||||
text->font_size = g_value_get_double (value);
|
||||
|
Reference in New Issue
Block a user