Add macro for possible NULL prints and use it on known sports
The macro is effective on OpenBSD and basically a no op on other platforms. Use it for one existing and the other known debug statements.
This commit is contained in:
@@ -54,6 +54,12 @@ void auto_free_gcharv(gchar*** args);
|
||||
void auto_free_char(char** str);
|
||||
#define auto_char __attribute__((__cleanup__(auto_free_char)))
|
||||
|
||||
#if defined(__OpenBSD__)
|
||||
#define STR_MAYBE_NULL(p) (p) ? : "(null)"
|
||||
#else
|
||||
#define STR_MAYBE_NULL(p) (p)
|
||||
#endif
|
||||
|
||||
// assume malloc stores at most 8 bytes for size of allocated memory
|
||||
// and page size is at least 4KB
|
||||
#define READ_BUF_SIZE 4088
|
||||
|
||||
Reference in New Issue
Block a user