text: Null-terminate a string if we've been gouging it
diff --git a/src/buf_text.c b/src/buf_text.c
index 8d2b141..cead599 100644
--- a/src/buf_text.c
+++ b/src/buf_text.c
@@ -143,6 +143,7 @@ int git_buf_text_lf_to_crlf(git_buf *tgt, const git_buf *src)
tgt->ptr[tgt->size++] = '\n';
}
+ tgt->ptr[tgt->size] = '\0';
return git_buf_put(tgt, scan, end - scan);
}