Merge pull request #77 from GabrielRavier/cmpUnclear

Make cmp usage clearer
This commit is contained in:
Clownacy 2019-11-09 14:05:04 +00:00 committed by GitHub
commit cb87f05057
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -31,7 +31,7 @@ BOOL LoadConfigData(CONFIG *conf)
fclose(fp); fclose(fp);
// Check if version is not correct, and return if it failed // Check if version is not correct, and return if it failed
if (fread_result != 1 || strcmp(conf->proof, config_magic)) if (fread_result != 1 || strcmp(conf->proof, config_magic) != 0)
{ {
memset(conf, 0, sizeof(CONFIG)); memset(conf, 0, sizeof(CONFIG));
return FALSE; return FALSE;

View file

@ -41,7 +41,7 @@ BOOL LoadMapData2(const char *path_map)
char check[3]; char check[3];
fread(check, 1, 3, fp); fread(check, 1, 3, fp);
if (memcmp(check, code_pxma, 3)) if (memcmp(check, code_pxma, 3) != 0)
{ {
fclose(fp); fclose(fp);
return FALSE; return FALSE;

View file

@ -68,7 +68,7 @@ BOOL LoadEvent(const char *path_event)
// Read "PXE" check // Read "PXE" check
char code[4]; char code[4];
fread(code, 1, 4, fp); fread(code, 1, 4, fp);
if (memcmp(code, gPassPixEve, 3)) if (memcmp(code, gPassPixEve, 3) != 0)
{ {
#ifdef FIX_BUGS #ifdef FIX_BUGS
// The original game forgot to close the file here // The original game forgot to close the file here

View file

@ -104,7 +104,7 @@ BOOL LoadProfile(const char *name)
// Check header code // Check header code
fread(profile.code, 8, 1, fp); fread(profile.code, 8, 1, fp);
if (memcmp(profile.code, gProfileCode, 8)) if (memcmp(profile.code, gProfileCode, 8) != 0)
{ {
#ifdef FIX_BUGS #ifdef FIX_BUGS
fclose(fp); // The original game forgets to close the file fclose(fp); // The original game forgets to close the file