projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83bc095
)
Fixed bug in brkstring(), newly introduced by the switch to strchr().
author
markus schnalke
<meillo@marmaro.de>
Wed, 4 Jan 2012 10:16:12 +0000
(11:16 +0100)
committer
markus schnalke
<meillo@marmaro.de>
Wed, 4 Jan 2012 10:16:12 +0000
(11:16 +0100)
strchr() treats the trailing null byte surprisingly:
``The terminating null byte is considered to be part of the string.''
sbr/brkstring.c
patch
|
blob
|
history
diff --git
a/sbr/brkstring.c
b/sbr/brkstring.c
index
68c7b70
..
da42d61
100644
(file)
--- a/
sbr/brkstring.c
+++ b/
sbr/brkstring.c
@@
-46,7
+46,7
@@
brkstring(char *str, char *brksep, char *brkterm)
}
/* handle separators */
- while (strchr(brksep, c = *s)) {
+ while ((c=*s) && strchr(brksep, c)) {
*s++ = '\0';
}