diff options
author | Ran Benita <ran234@gmail.com> | 2012-08-29 10:12:56 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-09-03 10:31:12 +0300 |
commit | 300f3fb1e051e4705a3d7787d508c10af98e4bb4 (patch) | |
tree | 527921d183e2855eec563448f95988c411a1d399 /src/utils.h | |
parent | bce90d5b2cd2fd840f8019d6ad0f30c352756ca6 (diff) | |
download | xorg-lib-libxkbcommon-300f3fb1e051e4705a3d7787d508c10af98e4bb4.tar.gz |
Don't printf NULL strings
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h index 4b2bb32..a3bd5d4 100644 --- a/src/utils.h +++ b/src/utils.h @@ -75,6 +75,12 @@ isempty(const char *s) return s == NULL || s[0] == '\0'; } +static inline const char * +strnull(const char *s) +{ + return s ? s : "(null)"; +} + #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) |