make sure we don't segfault when looking up a non-existant value name
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org> * gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't segfault when looking up a non-existant value name (reported by Pablo <pcj+gtk@primenet.com>).
This commit is contained in:
parent
b89ed0c35f
commit
bbe7d97e00
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -1,3 +1,9 @@
|
||||
Fri Oct 2 16:10:36 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktypeutils.c (gtk_type_enum_find_value): make sure we don't
|
||||
segfault when looking up a non-existant value name (reported by
|
||||
Pablo <pcj+gtk@primenet.com>).
|
||||
|
||||
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.h (gtk_clist_prepend):
|
||||
|
@ -683,18 +683,19 @@ gtk_type_enum_find_value (GtkType enum_type,
|
||||
GtkEnumValue *vals;
|
||||
|
||||
vals = gtk_type_enum_get_values (enum_type);
|
||||
while (vals)
|
||||
{
|
||||
if (strcmp (vals->value_name, value_name) == 0 ||
|
||||
strcmp (vals->value_nick, value_name) == 0)
|
||||
return vals;
|
||||
vals++;
|
||||
}
|
||||
if (vals)
|
||||
while (vals->value_name)
|
||||
{
|
||||
if (strcmp (vals->value_name, value_name) == 0 ||
|
||||
strcmp (vals->value_nick, value_name) == 0)
|
||||
return vals;
|
||||
vals++;
|
||||
}
|
||||
}
|
||||
else
|
||||
g_warning ("gtk_type_enum_find_value(): type `%s' is not derived from `GtkEnum' or `GtkFlags'",
|
||||
gtk_type_name (enum_type));
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user