mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Use err2txt for unknown error
This commit is contained in:
parent
78f24c1d89
commit
10082bc346
@ -25,7 +25,7 @@ static void oc_usage(void) LDAP_GCCATTR((noreturn));
|
||||
static void at_usage(void) LDAP_GCCATTR((noreturn));
|
||||
|
||||
static char *const err2text[] = {
|
||||
"",
|
||||
"Unknown Error",
|
||||
"Out of memory",
|
||||
"ObjectClass not found",
|
||||
"AttributeType not found",
|
||||
@ -44,7 +44,7 @@ char *
|
||||
scherr2str(int code)
|
||||
{
|
||||
if ( code < 1 || code >= (sizeof(err2text)/sizeof(char *)) ) {
|
||||
return "Unknown error";
|
||||
return err2text[0];
|
||||
} else {
|
||||
return err2text[code];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user