mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
Make split functions return an array with NULL instead of NULL
This avoids undefined behavior in functions that call these split functions and expect an array back instead of just a NULL pointer.
This commit is contained in:
parent
beb2beba3b
commit
0840eaec7b
2 changed files with 10 additions and 2 deletions
|
|
@ -198,7 +198,12 @@ char **recode_split(const SERVER_REC *server, const char *str,
|
|||
int n = 0;
|
||||
char **ret;
|
||||
|
||||
g_return_val_if_fail(str != NULL, NULL);
|
||||
g_warn_if_fail(str != NULL);
|
||||
if (str == NULL) {
|
||||
ret = g_new(char *, 1);
|
||||
ret[0] = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (settings_get_bool("recode")) {
|
||||
to = find_conversion(server, target);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue