summaryrefslogtreecommitdiffstats
path: root/src/rccenca.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rccenca.c')
-rw-r--r--src/rccenca.c7
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++);