]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
q3map2: fix bogus empty string checks
authorBen Noordhuis <info@bnoordhuis.nl>
Sat, 17 Mar 2012 22:53:12 +0000 (23:53 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Sun, 18 Mar 2012 01:17:09 +0000 (02:17 +0100)
qdir is an array, not a pointer, so `if (qdir)` is always true.

tools/quake3/common/cmdlib.c

index 5f20773f772378b9f1814f566f3331d1e7d39d54..35f4d75bd68dcb0767c820e73963420a8607c1c8 100644 (file)
@@ -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] == ':' ) {