From: Ben Noordhuis Date: Sat, 17 Mar 2012 22:53:12 +0000 (+0100) Subject: q3map2: fix bogus empty string checks X-Git-Tag: xonotic-v0.7.0~16^2~6^2~2^2^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=997811d430794eb9f3fedbb18838a1832a5efd0f;p=xonotic%2Fnetradiant.git q3map2: fix bogus empty string checks qdir is an array, not a pointer, so `if (qdir)` is always true. --- diff --git a/tools/quake3/common/cmdlib.c b/tools/quake3/common/cmdlib.c index 5f20773f..35f4d75b 100644 --- a/tools/quake3/common/cmdlib.c +++ b/tools/quake3/common/cmdlib.c @@ -244,7 +244,7 @@ char *ExpandArg( const char *path ){ char *ExpandPath( const char *path ){ static char full[1024]; - if ( !qdir ) { + if ( !qdir[0] ) { Error( "ExpandPath called without qdir set" ); } if ( path[0] == '/' || path[0] == '\\' || path[1] == ':' ) { @@ -257,7 +257,7 @@ char *ExpandPath( const char *path ){ char *ExpandGamePath( const char *path ){ static char full[1024]; - if ( !qdir ) { + if ( !qdir[0] ) { Error( "ExpandGamePath called without qdir set" ); } if ( path[0] == '/' || path[0] == '\\' || path[1] == ':' ) {