X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcclerrms.c;h=b0cafc11d36f077ec46ed0fbc2b041f0e5f7c34d;hb=a3e65bcd3250b107397675bc65b35b5939355025;hp=2d69c393f4b12d355b14b0635e278cda6541157e;hpb=88d3bedf772316f87e1996f655ccf8d1e2589755;p=yaz-moved-to-github.git diff --git a/src/cclerrms.c b/src/cclerrms.c index 2d69c39..b0cafc1 100644 --- a/src/cclerrms.c +++ b/src/cclerrms.c @@ -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. */ /** @@ -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,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 charcacter 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: