buf: Is this the function you were looking for?

This commit is contained in:
Vicent Marti 2013-01-12 01:40:35 +01:00
parent 3874f2d54f
commit 355dddbf08

View File

@ -111,7 +111,7 @@ bool git_buf_text_is_binary(const git_buf *buf)
bool git_buf_text_contains_nul(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) int git_buf_text_detect_bom(git_bom_t *bom, const git_buf *buf, size_t offset)