From 98f65e4782177c2d2f6c04c7c8f1f7c1cd9e615e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 20 Aug 2022 14:30:48 +0200 Subject: [PATCH] Log memory access error details even when no debug flag is set Signed-off-by: DL6ER --- src/shmem.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/shmem.c b/src/shmem.c index 648b3f44d..dbcf33f9b 100644 --- a/src/shmem.c +++ b/src/shmem.c @@ -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; } @@ -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; }