Commit eb8f90e523b344fc24358994ad63e737520b85b7

Vicent Martí 2012-02-27T17:22:51

buffer: Null terminate on rtrim

1
2
3
4
5
6
7
8
9
10
11
diff --git a/src/buffer.c b/src/buffer.c
index e86246f..68cc393 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -386,4 +386,6 @@ void git_buf_rtrim(git_buf *buf)
 
 		buf->size--;
 	}
+
+	buf->ptr[buf->size] = '\0';
 }