Use err2txt for unknown error

This commit is contained in:
Kurt Zeilenga 2000-06-06 05:54:36 +00:00
parent 78f24c1d89
commit 10082bc346

View File

@ -25,7 +25,7 @@ static void oc_usage(void) LDAP_GCCATTR((noreturn));
static void at_usage(void) LDAP_GCCATTR((noreturn)); static void at_usage(void) LDAP_GCCATTR((noreturn));
static char *const err2text[] = { static char *const err2text[] = {
"", "Unknown Error",
"Out of memory", "Out of memory",
"ObjectClass not found", "ObjectClass not found",
"AttributeType not found", "AttributeType not found",
@ -44,7 +44,7 @@ char *
scherr2str(int code) scherr2str(int code)
{ {
if ( code < 1 || code >= (sizeof(err2text)/sizeof(char *)) ) { if ( code < 1 || code >= (sizeof(err2text)/sizeof(char *)) ) {
return "Unknown error"; return err2text[0];
} else { } else {
return err2text[code]; return err2text[code];
} }