Mercurial > pidgin
comparison src/prefs.c @ 6295:44daf60ae44a
[gaim-migrate @ 6794]
don't let NULL string prefs wreak havoc
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 24 Jul 2003 05:32:53 +0000 |
parents | dc42b27101c0 |
children | 4bc050b1af34 |
comparison
equal
deleted
inserted
replaced
6294:430693544643 | 6295:44daf60ae44a |
---|---|
439 gaim_debug(GAIM_DEBUG_ERROR, "prefs", | 439 gaim_debug(GAIM_DEBUG_ERROR, "prefs", |
440 "gaim_prefs_set_string: %s not a string pref\n", name); | 440 "gaim_prefs_set_string: %s not a string pref\n", name); |
441 return; | 441 return; |
442 } | 442 } |
443 | 443 |
444 if(strcmp(pref->value.string, value)) { | 444 if((value && !pref->value.string) || |
445 (!value && pref->value.string) || | |
446 strcmp(pref->value.string, value)) { | |
445 g_free(pref->value.string); | 447 g_free(pref->value.string); |
446 pref->value.string = g_strdup(value); | 448 pref->value.string = g_strdup(value); |
447 do_callbacks(name, pref); | 449 do_callbacks(name, pref); |
448 } | 450 } |
449 } else { | 451 } else { |