(error_message): try to pass code to strerror, to see if it might be
an errno code (this if broken, but some MIT code seems to expect this behaviour) git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5164 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -48,16 +48,18 @@ RCSID("$Id$");
|
||||
|
||||
struct et_list *_et_list;
|
||||
|
||||
|
||||
const char *
|
||||
error_message (long code)
|
||||
{
|
||||
static char msg[128];
|
||||
const char *p = com_right(_et_list, code);
|
||||
if(p){
|
||||
if(p == NULL)
|
||||
p = strerror(code);
|
||||
if(p != NULL && *p != '\0')
|
||||
strcpy_truncate(msg, p, sizeof(msg));
|
||||
} else{
|
||||
else
|
||||
snprintf(msg, sizeof(msg), "Unknown error %d", code);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user