diff options
Diffstat (limited to 'util/errors.c')
-rw-r--r-- | util/errors.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/util/errors.c b/util/errors.c index 4436e78c0..b71ff4f49 100644 --- a/util/errors.c +++ b/util/errors.c @@ -25,6 +25,21 @@ #include "errors.h" +#ifndef HAVE_STRERROR +char * +strerror( int n ) +{ + extern char *sys_errlist[]; + extern int sys_nerr; + static char buf[15]; + + if( n >= 0 && n < sys_nerr ) + return sys_errlist[n]; + strcpy( buf, "Unknown error" ); + return buf; +} +#endif /* !HAVE_STRERROR */ + const char * g10_errstr( int err ) { |