From c06a49c551ebfc7f320a05546b5a013714ac82e5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Aug 2001 04:52:25 +0000 Subject: Update. 2001-08-27 Ulrich Drepper * misc/syslog.c (vsyslog): Try a bit harder to use syslogd. If the connection went down after we first used it try to connect again and resend the message before printing to the console. Reported by Coserea Gh. Tudor . 2001-08-27 Jakub Jelinek * string/tst-strlen.c (main): Test strnlen (, -1) too. * sysdeps/generic/strnlen.c (__strnlen): Fix for maxlens with top bit set. 2001-08-27 Ulrich Drepper * iconv/strtab.c (searchstring): Use correct length for comparison. (strtabadd): Account total size correct if new string has old string as substring. --- iconv/strtab.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'iconv') diff --git a/iconv/strtab.c b/iconv/strtab.c index d567f57..4189f97 100644 --- a/iconv/strtab.c +++ b/iconv/strtab.c @@ -193,7 +193,7 @@ searchstring (struct Strent **sep, struct Strent *newstr) /* Compare the strings. */ cmpres = memcmp ((*sep)->reverse, newstr->reverse, - MIN ((*sep)->len, newstr->len)); + MIN ((*sep)->len, newstr->len) - 1); if (cmpres == 0) /* We found a matching string. */ return sep; @@ -236,10 +236,9 @@ strtabadd (struct Strtab *st, const char *str, size_t len) /* When we get here it means that the string we are about to add has a common prefix with a string we already have but it is longer. In this case we have to put it first. */ + st->total += newstr->len - (*sep)->len; newstr->next = *sep; *sep = newstr; - - st->total += newstr->len - (*sep)->len; } else { -- cgit v1.1