]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Check return value of chdir
authorHans de Goede <hdegoede@redhat.com>
Fri, 22 Apr 2011 17:56:00 +0000 (19:56 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 22 Apr 2011 17:56:09 +0000 (19:56 +0200)
Not checking this causes a warning when building under Fedora which becomes
an error because of -Werror.

src/main.cpp

index e24da3195cd9368f02db07b14e52084112ea6be9..c5e9ba84954eafd151d7a51a5ee294aa0cceb79f 100644 (file)
@@ -104,7 +104,11 @@ int main(int argc, char *argv[])
        #endif
 
        #if RELEASE
-       chdir(PAKLOCATION);
+       if (chdir(PAKLOCATION))
+       {
+               perror("Could not chdir to " PAKLOCATION ":");
+               return 1;
+       }
        #endif
        
        config.engine = &engine;