diff options
Diffstat (limited to 'lib/log.c')
-rw-r--r-- | lib/log.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -498,3 +498,11 @@ mes_lookup (struct message *meslist, int max, int index) } return meslist[index].str; } + +/* Wrapper around strerror to handle case where it returns NULL. */ +const char * +safe_strerror(int errnum) +{ + const char *s = strerror(errnum); + return (s != NULL) ? s : "Unknown error"; +} |