mirror of https://github.com/fltk/fltk
Fix potential crash in fluid (issue #14)
trimclassname() would crash if it was given a NULL pointer. Now a NULL pointer is returned instead. Fixes #14
This commit is contained in:
parent
7a3af40ede
commit
42afc70b6a
|
@ -1479,6 +1479,8 @@ void Fl_Widget_Class_Type::read_property(const char *c) {
|
|||
// Convert A::B::C::D to D (i.e. keep only innermost name)
|
||||
// This is useful for classes that contain a namespace component
|
||||
static const char *trimclassname(const char *n) {
|
||||
if (!n)
|
||||
return NULL;
|
||||
const char *nn;
|
||||
while((nn = strstr(n, "::"))) {
|
||||
n = nn + 2;
|
||||
|
|
Loading…
Reference in New Issue