From 690b7da850a2a241ca220b21938ec114c919d87b Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sat, 31 Dec 2005 00:10:22 +0000 Subject: 64bit fixes + Fixed segmentation on 64 bit systems + SPEC file usable in both 32 and 64 bit environments --- src/recode.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/recode.c') diff --git a/src/recode.c b/src/recode.c index 9e19078..8c6cc40 100644 --- a/src/recode.c +++ b/src/recode.c @@ -511,17 +511,20 @@ rcc_string rccSizedFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, } } else icnv = ctx->iconv_from[class_id]; - + if (icnv) { ret = rccIConvInternal(ctx, icnv, buf, len); - if (ret == (size_t)-1) return NULL; + if (ret == (size_t)-1) { + rccMutexUnLock(ctx->mutex); + return NULL; + } if ((rccGetOption(ctx, RCC_OPTION_TRANSLATE))&&(rccGetClassType(ctx, class_id) == RCC_CLASS_TRANSLATE_FROM)) { config = rccGetCurrentConfig(ctx); translate = rccRecodeTranslate(&config , class_id, ctx->tmpbuffer); if (translate) language_id = rccConfigGetLanguage(config); } - + result = rccCreateString(language_id, translate?translate:ctx->tmpbuffer, translate?0:ret); } else { if ((rccGetOption(ctx, RCC_OPTION_TRANSLATE))&&(rccGetClassType(ctx, class_id) == RCC_CLASS_TRANSLATE_FROM)) { -- cgit v1.2.3