projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 4.2.58
[yaz-moved-to-github.git]
/
src
/
cclerrms.c
diff --git
a/src/cclerrms.c
b/src/cclerrms.c
index
b7ddd61
..
7817744
100644
(file)
--- a/
src/cclerrms.c
+++ b/
src/cclerrms.c
@@
-1,16
+1,17
@@
-/*
- * Copyright (C) 1995-2008, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: cclerrms.c,v 1.4 2008-01-09 21:32:27 adam Exp $
*/
*/
-/**
+/**
* \file cclerrms.c
* \brief Implements CCL error code to error string map.
*
* This source file implements mapping between CCL error code and
* their string equivalents.
*/
* \file cclerrms.c
* \brief Implements CCL error code to error string map.
*
* This source file implements mapping between CCL error code and
* their string equivalents.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/ccl.h>
#include <yaz/ccl.h>
@@
-27,21
+28,23
@@
static char *err_msg_array[] = {
"Bad relation",
"Left truncation not supported",
"Both left - and right truncation not supported",
"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:
* c-basic-offset: 4
}
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab