diff options
Diffstat (limited to 'crypto/heimdal/lib/com_err/com_err.c')
-rw-r--r-- | crypto/heimdal/lib/com_err/com_err.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/heimdal/lib/com_err/com_err.c b/crypto/heimdal/lib/com_err/com_err.c index 7975739..ea0ac7c 100644 --- a/crypto/heimdal/lib/com_err/com_err.c +++ b/crypto/heimdal/lib/com_err/com_err.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$Id: com_err.c,v 1.17 2001/05/11 20:02:34 assar Exp $"); +RCSID("$Id: com_err.c,v 1.18 2002/03/10 23:07:01 assar Exp $"); #endif #include <stdio.h> #include <stdlib.h> @@ -49,8 +49,12 @@ error_message (long code) { static char msg[128]; const char *p = com_right(_et_list, code); - if (p == NULL) - p = strerror(code); + if (p == NULL) { + if (code < 0) + sprintf(msg, "Unknown error %ld", code); + else + p = strerror(code); + } if (p != NULL && *p != '\0') { strncpy(msg, p, sizeof(msg) - 1); msg[sizeof(msg) - 1] = 0; |