Commit 9ff07c24f5922b65526253711353d8f308bc9dde

Carlos Martín Nieto 2012-11-30T15:17:05

buf test: make sure we always set the bom variable

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/buf_text.c b/src/buf_text.c
index 3c5024e..6cb8c3d 100644
--- a/src/buf_text.c
+++ b/src/buf_text.c
@@ -114,6 +114,7 @@ int git_buf_text_detect_bom(git_bom_t *bom, const git_buf *buf, size_t offset)
 	const char *ptr;
 	size_t len;
 
+	*bom = GIT_BOM_NONE;
 	/* need at least 2 bytes after offset to look for any BOM */
 	if (buf->size < offset + 2)
 		return 0;