summaryrefslogtreecommitdiffstats
path: root/src/librcd.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-26 02:38:17 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-26 02:38:17 +0000
commit0ac47ed6926321840f0b5b2962225583fd22f3be (patch)
tree679286c040db87c068aeb42a97b6a6eebc1bffc0 /src/librcd.c
parent3eb07c57e4340c1bc174cc716f9e3902cc40548f (diff)
downloadlibrcd-0ac47ed6926321840f0b5b2962225583fd22f3be.tar.gz
librcd-0ac47ed6926321840f0b5b2962225583fd22f3be.tar.bz2
librcd-0ac47ed6926321840f0b5b2962225583fd22f3be.tar.xz
librcd-0ac47ed6926321840f0b5b2962225583fd22f3be.zip
FreeBSD fix
- String length handling is revised to LibRCC style - The 'strnlen' function is not any more called
Diffstat (limited to 'src/librcd.c')
-rw-r--r--src/librcd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/librcd.c b/src/librcd.c
index 18681ae..55eefc0 100644
--- a/src/librcd.c
+++ b/src/librcd.c
@@ -7,8 +7,6 @@
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a<b)?a:b)
#define bit(i) (1<<i)
-#define STRNLEN(str,n) (n?strnlen(str,n):strlen(str))
-
typedef struct lng_stat2 {
unsigned char a;
@@ -259,7 +257,7 @@ static int check_utf8(const unsigned char *buf, int len) {
rcd_russian_charset rcdGetRussianCharset(const char *buf,int len) {
long l;
- l = STRNLEN(buf,len);
+ l = len?len:strlen(buf);
if (check_utf8(buf,l)>1) return RUSSIAN_CHARSET_UTF8;
return is_win_charset2(buf,l);
}