git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
175a494
)
Use strchrnul() instead of strchr() plus manual workaround
author
Johan Herland
<redacted>
Sat, 27 Sep 2008 22:24:36 +0000
(
00:24
+0200)
committer
Shawn O. Pearce
<redacted>
Mon, 29 Sep 2008 15:56:26 +0000
(08:56 -0700)
Also gets rid of a C++ comment.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
builtin-for-each-ref.c
patch
|
blob
|
history
diff --git
a/builtin-for-each-ref.c
b/builtin-for-each-ref.c
index be9dc9e3f0dbbd9bdda20db7fd5c5fad8e427bd2..72c087840c39bc03b142ba620f94800d40264eb9 100644
(file)
--- a/
builtin-for-each-ref.c
+++ b/
builtin-for-each-ref.c
@@
-320,9
+320,7
@@
static const char *find_wholine(const char *who, int wholen, const char *buf, un
static const char *copy_line(const char *buf)
{
- const char *eol = strchr(buf, '\n');
- if (!eol) // simulate strchrnul()
- eol = buf + strlen(buf);
+ const char *eol = strchrnul(buf, '\n');
return xmemdupz(buf, eol - buf);
}
git clone https://git.99rst.org/PROJECT