diff options
author | nectar <nectar@FreeBSD.org> | 2002-08-30 21:23:27 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2002-08-30 21:23:27 +0000 |
commit | a77dba08ca7d8ad2f2dcd653974ac66df78cfa49 (patch) | |
tree | 6015f89700252fb05eb8fa267c46dba41913e9d8 /crypto/heimdal/lib/com_err/com_err.c | |
parent | 69a91bec14ec3ad49d1c8a82c40a796755f9e4a3 (diff) | |
download | FreeBSD-src-a77dba08ca7d8ad2f2dcd653974ac66df78cfa49.zip FreeBSD-src-a77dba08ca7d8ad2f2dcd653974ac66df78cfa49.tar.gz |
Import of Heimdal Kerberos from KTH repository circa 2002/08/29.
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; |