]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/profile/profile.cpp
gcc: appease the hardening warnings
[xonotic/netradiant.git] / libs / profile / profile.cpp
index 71d2ae1b9c18b250cae0e987d042764a7c1f8d11..6121d77009c1f503f408e08366c2de0965f7a616 100644 (file)
@@ -43,6 +43,7 @@
 #include "file.h"
 
 #include <stdlib.h>
+#include <cassert>
 
 #include "str.h"
 
@@ -120,7 +121,7 @@ bool save_var( const char *filename, const char *section, const char *key, const
                len = ftell( rc );
                rewind( rc );
                buf = malloc( len );
-               fread( buf, len, 1, rc );
+        assert(fread( buf, len, 1, rc ));
                old_rc.write( reinterpret_cast<MemStream::byte_type*>( buf ), len );
                free( buf );
                fclose( rc );
@@ -252,7 +253,7 @@ bool profile_load_buffer( const char * rc_path, const char *name, void *buffer,
                fclose( f );
        }
 
-       return true;
+       return ret;
 }
 
 int profile_load_int( const char *filename, const char *section, const char *key, int default_value ){