summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commit.c b/src/commit.c
index 4a340058a..0ec989421 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -442,7 +442,7 @@ int git_commit__parse(void *_commit, git_odb_object *odb_obj)
while (eoln < buffer_end && *eoln != '\n')
++eoln;
- if (git__prefixcmp(buffer, "encoding ") == 0) {
+ if (git__prefixncmp(buffer, buffer_end - buffer, "encoding ") == 0) {
buffer += strlen("encoding ");
commit->message_encoding = git__strndup(buffer, eoln - buffer);