diff options
author | ajs <ajs> | 2004-11-19 23:40:16 +0000 |
---|---|---|
committer | ajs <ajs> | 2004-11-19 23:40:16 +0000 |
commit | 0f4518e1ec10a3553a5984a8ccc03b2dbc2f1eab (patch) | |
tree | fddcdc2da786f9b17e9b6451dd8279a8c8699f89 /lib/log.c | |
parent | 2ae15c0fd47dab8ca71ed6e0caac12ecc1ccb66a (diff) | |
download | quagga-0f4518e1ec10a3553a5984a8ccc03b2dbc2f1eab.tar.bz2 quagga-0f4518e1ec10a3553a5984a8ccc03b2dbc2f1eab.tar.xz |
2004-11-19 David Young <dyoung@pobox.com>
* log.c: (safe_strerror) New function: safe wrapper for strerror.
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"; +} |