diff options
author | /dev/humancontroller <devhc@example.com> | 2017-01-28 15:28:54 +0100 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:17 +0100 |
commit | 05cb487661989c52654c20f7dc4cc6caacc9e86a (patch) | |
tree | 0a66ead775071c45d8b3a8476800633b8e502287 | |
parent | 196c6a82fd4d44cbd0b72c578dee3448c3da4e66 (diff) |
fix Info_SetValueForKey() for ("...", NULL) calls
-rw-r--r-- | src/qcommon/q_shared.c | 22 |
1 files changed, 14 insertions, 8 deletions
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; + } } } |