summaryrefslogtreecommitdiff
path: root/src/buf_text.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-01-12 01:40:35 +0100
committerVicent Marti <tanoku@gmail.com>2013-01-12 01:40:35 +0100
commit355dddbf08ade85584f94dfb0eb4df46cb504035 (patch)
treeec458b5cf4634590c92a8bebeb21c59d5b04cdc0 /src/buf_text.c
parent3874f2d54fc693c2fc4488604c56ec74cd24de17 (diff)
downloadlibgit2-355dddbf08ade85584f94dfb0eb4df46cb504035.tar.gz
buf: Is this the function you were looking for?
Diffstat (limited to 'src/buf_text.c')
-rw-r--r--src/buf_text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buf_text.c b/src/buf_text.c
index 0104a9057..3a8f442b4 100644
--- a/src/buf_text.c
+++ b/src/buf_text.c
@@ -111,7 +111,7 @@ bool git_buf_text_is_binary(const git_buf *buf)
bool git_buf_text_contains_nul(const git_buf *buf)
{
- return (strnlen(buf->ptr, buf->size) != buf->size);
+ return (memchr(buf->ptr, '\0', buf->size) != NULL);
}
int git_buf_text_detect_bom(git_bom_t *bom, const git_buf *buf, size_t offset)