Avoiding crash when passing NULL as a string in Fl_Preferences::set(key, char *string_value);

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5198 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2006-06-14 08:03:16 +00:00
parent fee47dba98
commit bc03e9b1a9

View File

@ -351,7 +351,7 @@ char Fl_Preferences::get( const char *key, char *&text, const char *defaultValue
*/
char Fl_Preferences::set( const char *key, const char *text )
{
const char *s = text;
const char *s = text ? text : "";
int n=0, ns=0;
for ( ; *s; s++ ) { n++; if ( *s<32 || *s=='\\' || *s==0x7f ) ns+=4; }
if ( ns )