diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-04 04:14:58 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-04 04:14:58 +0000 |
commit | a21deef1c62467b21500f94dfb2ab3d58e69cb85 (patch) | |
tree | 742d2c1e2592fbcb580ebce9fac7f4f867e6218b /src/rccenca.c | |
parent | 97e76f4c979d7a0c4ed296c512c3024e3c6afa18 (diff) | |
download | librcc-a21deef1c62467b21500f94dfb2ab3d58e69cb85.tar.gz librcc-a21deef1c62467b21500f94dfb2ab3d58e69cb85.tar.bz2 librcc-a21deef1c62467b21500f94dfb2ab3d58e69cb85.tar.xz librcc-a21deef1c62467b21500f94dfb2ab3d58e69cb85.zip |
04.07.2005
Diffstat (limited to 'src/rccenca.c')
-rw-r--r-- | src/rccenca.c | 7 |
1 files changed, 5 insertions, 2 deletions
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++); |