projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
693bfba
)
oops, ascii_strncasecmp tried to compare one byte too far
author
Pierre Habouzit
<madcoder@debian.org>
Sat, 2 Dec 2006 13:34:23 +0000
(14:34 +0100)
committer
Pierre Habouzit
<madcoder@debian.org>
Sat, 2 Dec 2006 13:34:23 +0000
(14:34 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-lib/str.c
patch
|
blob
|
history
diff --git
a/lib-lib/str.c
b/lib-lib/str.c
index
39e6a90
..
f421530
100644
(file)
--- a/
lib-lib/str.c
+++ b/
lib-lib/str.c
@@
-181,9
+181,9
@@
int ascii_strcasecmp(const char *a, const char *b)
if (a == b)
return 0;
if (!a)
-
a = ""
;
+
return -1
;
if (!b)
-
b = ""
;
+
return 1
;
while (*a || *b) {
int i;
@@
-206,11
+206,11
@@
int ascii_strncasecmp(const char *a, const char *b, ssize_t n)
if (a == b)
return 0;
if (!a)
-
a = ""
;
+
return -1
;
if (!b)
-
b = ""
;
+
return 1
;
- while ((*a || *b) && n >
=
0) {
+ while ((*a || *b) && n > 0) {
int i;
if ((i = ascii_tolower(*a++) - ascii_tolower(*b++)))
return i;