CCL: fix spell error in message
[yaz-moved-to-github.git] / src / cclerrms.c
index c6553f5..7e0ac37 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
 /** 
@@ -28,17 +28,18 @@ static char *err_msg_array[] = {
     "Bad relation",
     "Left truncation not supported",
     "Both left - and right truncation not supported",
-    "Right truncation not supported"
+    "Right truncation not supported",
+    "Embedded truncation not supported",
+    "Single character mask not supported"
 };
 
-/*
- * ccl_err_msg: return name of CCL error
- * ccl_errno:   Error no.
- * return:      Name of error.
- */
-const char *ccl_err_msg (int ccl_errno)
+const char *ccl_err_msg(int ccl_errno)
 {
-    return err_msg_array[ccl_errno];
+    if (ccl_errno >= 0 && 
+        ccl_errno < sizeof(err_msg_array)/sizeof(*err_msg_array))
+        return err_msg_array[ccl_errno];
+    else
+        return 0;
 }
 /*
  * Local variables: