- utils.c: Fix gkrellm_gtk_entry_get_text() default return value (empty string was allocated on the stack and is now a proper static variable)

This commit is contained in:
Stefan Gehn 2008-09-30 14:51:48 +00:00
parent e03fa87217
commit cb4a2344eb
1 changed files with 9 additions and 6 deletions

View File

@ -239,12 +239,15 @@ gkrellm_make_home_subdir(gchar *subdir, gchar **path)
gchar *
gkrellm_gtk_entry_get_text(GtkWidget **entry)
{
gchar *s = "";
static /*const*/ gchar *def_s = "";
gchar *s = def_s;
if (*entry)
s = (gchar *) gtk_entry_get_text(GTK_ENTRY(*entry));
{
s = (gchar *)gtk_entry_get_text(GTK_ENTRY(*entry));
while (*s == ' ' || *s == '\t')
++s;
}
return s;
}