diff options
author | ajs <ajs> | 2004-11-20 00:40:16 +0100 |
---|---|---|
committer | ajs <ajs> | 2004-11-20 00:40:16 +0100 |
commit | ca35976927190883368ef3bd32bbf9f174575bd6 (patch) | |
tree | aa3b9fa981719c48f0418abb06355e88ee39dbcb /lib/log.c | |
parent | 2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu> (diff) | |
download | frr-ca35976927190883368ef3bd32bbf9f174575bd6.tar.xz frr-ca35976927190883368ef3bd32bbf9f174575bd6.zip |
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"; +} |