From 997811d430794eb9f3fedbb18838a1832a5efd0f Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 17 Mar 2012 23:53:12 +0100 Subject: [PATCH] q3map2: fix bogus empty string checks qdir is an array, not a pointer, so `if (qdir)` is always true. --- tools/quake3/common/cmdlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] == ':' ) { -- 2.39.2