X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcclerrms.c;h=218ac0f5645be2aad08013bef3170df33062d23f;hp=e9b6a87116fb0a939bbc4cb5ddacec06034a29c0;hb=bd4ea696fa932a215d18268afd1850035f7ebd05;hpb=ba1f112c74932545871791eaf2c2e4cfe4014ee5 diff --git a/src/cclerrms.c b/src/cclerrms.c index e9b6a87..218ac0f 100644 --- a/src/cclerrms.c +++ b/src/cclerrms.c @@ -1,8 +1,8 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ -/** +/** * \file cclerrms.c * \brief Implements CCL error code to error string map. * @@ -30,12 +30,16 @@ static char *err_msg_array[] = { "Both left - and right truncation not supported", "Right truncation not supported", "Embedded truncation not supported", - "Single charcacter mask not supported" + "Single character mask not supported" }; 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: