From 05cb487661989c52654c20f7dc4cc6caacc9e86a Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 28 Jan 2017 15:28:54 +0100 Subject: fix Info_SetValueForKey() for ("...", NULL) calls --- src/qcommon/q_shared.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index 933df9eb..359fe4dd 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -1332,12 +1332,15 @@ void Info_SetValueForKey( char *s, const char *key, const char *value ) { Com_Error( ERR_DROP, "Info_SetValueForKey: oversize infostring" ); } - for(; *blacklist; ++blacklist) + if (value) { - if (strchr (key, *blacklist) || strchr (value, *blacklist)) + for(; *blacklist; ++blacklist) { - Com_Printf (S_COLOR_YELLOW "Can't use keys or values with a '%c': %s = %s\n", *blacklist, key, value); - return; + if (strchr (key, *blacklist) || strchr (value, *blacklist)) + { + Com_Printf (S_COLOR_YELLOW "Can't use keys or values with a '%c': %s = %s\n", *blacklist, key, value); + return; + } } } @@ -1373,12 +1376,15 @@ void Info_SetValueForKey_Big( char *s, const char *key, const char *value ) { Com_Error( ERR_DROP, "Info_SetValueForKey: oversize infostring" ); } - for(; *blacklist; ++blacklist) + if (value) { - if (strchr (key, *blacklist) || strchr (value, *blacklist)) + for(; *blacklist; ++blacklist) { - Com_Printf (S_COLOR_YELLOW "Can't use keys or values with a '%c': %s = %s\n", *blacklist, key, value); - return; + if (strchr (key, *blacklist) || strchr (value, *blacklist)) + { + Com_Printf (S_COLOR_YELLOW "Can't use keys or values with a '%c': %s = %s\n", *blacklist, key, value); + return; + } } } -- cgit