Skip to content

Commit

Permalink
Log memory access error details even when no debug flag is set
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Aug 20, 2022
1 parent da33517 commit 98f65e4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,11 +1004,8 @@ static inline bool check_range(int ID, int MAXID, const char* type, int line, co
// Check bounds
if(ID < 0 || ID > MAXID)
{
if(config.debug)
{
logg("ERROR: Trying to access %s ID %i, but maximum is %i", type, ID, MAXID);
logg(" found in %s() (%s:%i)", function, file, line);
}
logg("ERROR: Trying to access %s ID %i, but maximum is %i", type, ID, MAXID);
logg(" found in %s() (%s:%i)", function, file, line);
return false;
}

Expand All @@ -1021,11 +1018,8 @@ static inline bool check_magic(int ID, bool checkMagic, unsigned char magic, con
// Check magic only if requested (skipped for new entries which are uninitialized)
if(checkMagic && magic != MAGICBYTE)
{
if(config.debug)
{
logg("ERROR: Trying to access %s ID %i, but magic byte is %x", type, ID, magic);
logg(" found in %s() (%s:%i)", function, file, line);
}
logg("ERROR: Trying to access %s ID %i, but magic byte is %x", type, ID, magic);
logg(" found in %s() (%s:%i)", function, file, line);
return false;
}

Expand Down

0 comments on commit 98f65e4

Please sign in to comment.