- 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:
parent
e03fa87217
commit
cb4a2344eb
11
src/utils.c
11
src/utils.c
|
@ -239,12 +239,15 @@ gkrellm_make_home_subdir(gchar *subdir, gchar **path)
|
||||||
gchar *
|
gchar *
|
||||||
gkrellm_gtk_entry_get_text(GtkWidget **entry)
|
gkrellm_gtk_entry_get_text(GtkWidget **entry)
|
||||||
{
|
{
|
||||||
gchar *s = "";
|
static /*const*/ gchar *def_s = "";
|
||||||
|
gchar *s = def_s;
|
||||||
|
|
||||||
if (*entry)
|
if (*entry)
|
||||||
s = (gchar *) gtk_entry_get_text(GTK_ENTRY(*entry));
|
{
|
||||||
while (*s == ' ' || *s == '\t')
|
s = (gchar *)gtk_entry_get_text(GTK_ENTRY(*entry));
|
||||||
++s;
|
while (*s == ' ' || *s == '\t')
|
||||||
|
++s;
|
||||||
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue