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>
|
2007-07-20 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/tools/gimprectangletool.c: fixed a gtk-doc comment.
|
* app/tools/gimprectangletool.c: fixed a gtk-doc comment.
|
||||||
|
@ -364,13 +364,22 @@ gimp_text_set_property (GObject *object,
|
|||||||
case PROP_FONT:
|
case PROP_FONT:
|
||||||
{
|
{
|
||||||
const gchar *font = g_value_get_string (value);
|
const gchar *font = g_value_get_string (value);
|
||||||
gsize len = strlen (font);
|
|
||||||
|
|
||||||
if (g_str_has_suffix (font, " Not-Rotated"))
|
|
||||||
len -= strlen ( " Not-Rotated");
|
|
||||||
|
|
||||||
g_free (text->font);
|
g_free (text->font);
|
||||||
text->font = g_strndup (font, len);
|
|
||||||
|
if (font)
|
||||||
|
{
|
||||||
|
gsize len = strlen (font);
|
||||||
|
|
||||||
|
if (g_str_has_suffix (font, " Not-Rotated"))
|
||||||
|
len -= strlen ( " Not-Rotated");
|
||||||
|
|
||||||
|
text->font = g_strndup (font, len);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
text->font = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_FONT_SIZE:
|
case PROP_FONT_SIZE:
|
||||||
|
Reference in New Issue
Block a user