summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-09-05 02:33:02 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-09-09 13:12:11 +0200
commitb87600cb6b80678f1ef8ca994785a4ba733c2133 (patch)
treef76abab90003672b7207a6c256140a548bf28bfb /src/buffer.c
parentb0bda0a4ee248ab3b0ccd0fad2f62b8b66c5fc6c (diff)
downloadlibgit2-b87600cb6b80678f1ef8ca994785a4ba733c2133.tar.gz
buffer: add git_buf_clear
Set the size to zero so the memory that has already been allocated can be reused Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 6af4c9195..3cdc62f6d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -93,3 +93,8 @@ void git_buf_free(git_buf *buf)
{
free(buf->ptr);
}
+
+void git_buf_clear(git_buf *buf)
+{
+ buf->size = 0;
+}