X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcclerrms.c;h=7e0ac37d2866307483256448f6a5819c9783c6a7;hp=0be69436f91d794e165ece4cc92e717b21546379;hb=51595f1f496ef99ccbe325f1984f46575fd46ea8;hpb=2788a4851b551e1a3efb320a2878b809f2d8a9d7 diff --git a/src/cclerrms.c b/src/cclerrms.c index 0be6943..7e0ac37 100644 --- a/src/cclerrms.c +++ b/src/cclerrms.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. */ /** @@ -9,6 +9,9 @@ * This source file implements mapping between CCL error code and * their string equivalents. */ +#if HAVE_CONFIG_H +#include +#endif #include @@ -25,21 +28,23 @@ 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: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab