From 2721c9054f96693a77cb522358beb9021038edc7 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 15 Dec 2008 17:10:09 +0000 Subject: Provide GPL disclaimers with all sources - Add GPL disclaimers to all sources - Suppress gcc-4.2 warnings --- src/engine.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/engine.c') diff --git a/src/engine.c b/src/engine.c index 3d3e023..57654e8 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1,3 +1,22 @@ +/* + LibRCC - Autodetection engines abstraction + + Copyright (C) 2005-2008 Suren A. Chilingaryan + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include #include @@ -183,7 +202,7 @@ static int CheckWestern(const unsigned char *buf, int len) { long i,j; int bytes=0; - if (!len) len = strlen(buf); + if (!len) len = strlen((char*)buf); for (i=0;i0) { // Western is 0x100-0x17e @@ -213,7 +232,7 @@ rcc_autocharset_id rccEngineDetectCharset(rcc_engine_context ctx, const char *bu /* DS: This should be done directly in autoengines, otherwise we will fail to detect 7bit encodings */ - if (CheckWestern(buf, len)) { + if (CheckWestern((const unsigned char*)buf, len)) { utf=rccConfigGetAutoCharsetByName(ctx->config, "UTF-8"); if (utf != (rcc_autocharset_id)-1) return utf; utf=rccConfigGetAutoCharsetByName(ctx->config, "UTF8"); -- cgit v1.2.3