1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Do not crash when settings_get_str returns NULL.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4341 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2006-09-12 15:52:04 +00:00 committed by exg
parent b25c8cf1d1
commit 35574b10c4

View File

@ -72,8 +72,14 @@ SV *
settings_get_str(key) settings_get_str(key)
char *key char *key
CODE: CODE:
RETVAL = newSVpv(settings_get_str(key), 0); const char *str;
SvUTF8_on(RETVAL);
RETVAL = NULL;
str = settings_get_str(key);
if (str != NULL) {
RETVAL = newSVpv(str, 0);
SvUTF8_on(RETVAL);
}
OUTPUT: OUTPUT:
RETVAL RETVAL