static void oc_usage(void);
static void at_usage(void);
-static char *const err2text[SLAP_SCHERR_LAST+1] = {
+static char *const err2text[] = {
"Success",
"Out of memory",
"ObjectClass not found",
"ObjectClass inappropriate SUPerior",
"ObjectClass operational",
+ "Duplicate objectClass",
"AttributeType not found",
"AttributeType inappropriate USAGE",
- "Duplicate objectClass",
+ "AttributeType inappropriate SUPerior",
+ "AttributeType SYNTAX or SUPerior required",
"Duplicate attributeType",
- "Duplicate ldapSyntax",
- "Duplicate matchingRule",
- "OID or name required",
- "SYNTAX or SUPerior required",
"MatchingRule not found",
+ "Duplicate matchingRule",
"Syntax not found",
"Syntax required",
+ "Duplicate ldapSyntax",
+ "OID or name required",
"Qualifier not supported",
"Invalid NAME",
"OID could not be expanded"
char *
scherr2str(int code)
{
- if ( code < 0 || code >= (int)(sizeof(err2text)/sizeof(char *)) ) {
+ if ( code < 0 || SLAP_SCHERR_LAST <= code ) {
return "Unknown error";
} else {
return err2text[code];