summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-12-31 00:10:22 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-12-31 00:10:22 +0000
commit690b7da850a2a241ca220b21938ec114c919d87b (patch)
tree900be0b1dea1811be61ab4ed29d303bb895f8ec4 /src
parent907199c194af0cb3912219b808aab13df763c022 (diff)
downloadlibrcc-690b7da850a2a241ca220b21938ec114c919d87b.tar.gz
librcc-690b7da850a2a241ca220b21938ec114c919d87b.tar.bz2
librcc-690b7da850a2a241ca220b21938ec114c919d87b.tar.xz
librcc-690b7da850a2a241ca220b21938ec114c919d87b.zip
64bit fixes
+ Fixed segmentation on 64 bit systems + SPEC file usable in both 32 and 64 bit environments
Diffstat (limited to 'src')
-rw-r--r--src/rcciconv.c4
-rw-r--r--src/recode.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/src/rcciconv.c b/src/rcciconv.c
index b518cd7..6d3d1b0 100644
--- a/src/rcciconv.c
+++ b/src/rcciconv.c
@@ -9,7 +9,7 @@
#define RCC_MAX_ERRORS 3
-static void rccIConvCopySymbol(char **in_buf, int *in_left, char **out_buf, int *out_left) {
+static void rccIConvCopySymbol(char **in_buf, size_t *in_left, char **out_buf, size_t *out_left) {
if ((out_left>0)&&(in_left>0)) {
/* (**out_buf)=(**in_buf);
(*out_buf)++;
@@ -57,7 +57,7 @@ int rccIConvGetError(rcc_iconv icnv) {
size_t rccIConvRecode(rcc_iconv icnv, char *outbuf, size_t outsize, const char *buf, size_t size) {
char *in_buf, *out_buf, err;
- int in_left, out_left;
+ size_t in_left, out_left;
int ub, utf_mode=0;
int errors=0;
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)) {