summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog3
-rw-r--r--VERSION2
-rw-r--r--src/librcd.c4
3 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e0466e7..ffa6034 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.1.7:
+ * Don't use strnlen
+
0.1.6:
* Function name is changed to conform LibRCC naming conventions
* Other minor changes
diff --git a/VERSION b/VERSION
index 8bd4f43..1180819 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.7CVS
+0.1.7
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);
}