From a21deef1c62467b21500f94dfb2ab3d58e69cb85 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 4 Jul 2005 04:14:58 +0000 Subject: 04.07.2005 --- src/rccenca.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/rccenca.c') diff --git a/src/rccenca.c b/src/rccenca.c index 20e1eb4..1aabf7a 100644 --- a/src/rccenca.c +++ b/src/rccenca.c @@ -59,7 +59,7 @@ rcc_charset_id rccEnca(rcc_engine_context ctx, const char *buf, int len) { if ((!internal)||(!buf)) return -1; - len = STRLEN(buf, len); + len = STRNLEN(buf, len); ee = enca_analyse_const((EncaAnalyser)ctx->internal,buf,len); if (ee.charset<0) return -1; @@ -145,7 +145,10 @@ int rccEncaInit() { for (j=0;engines[j];j++) if (j >= RCC_MAX_ENGINES) continue; - charsets = enca_get_language_charsets(rcc_default_languages[i].sn, &n_charsets); + if (strlen(rcc_default_languages[i].sn)==2) + charsets = enca_get_language_charsets(rcc_default_languages[i].sn, &n_charsets); + else + charsets = NULL; if (charsets) { memcpy(enca_engines+i, &rcc_enca_engine, sizeof(rcc_engine)); for (k=0;enca_engines[i].charsets[k];k++); -- cgit v1.2.3