summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-13 23:28:51 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-13 23:28:51 +0100
commita21bb1aa33e9887c06852db62526895df6091736 (patch)
tree6e05069971f04fb91f36d91818f78a62de93c1b1 /src/buffer.c
parent96ef3d84629ef72fb662d95abbab3de634921678 (diff)
parent86ea6ceda75274621b7d5c3023c5b04da3ab677e (diff)
downloadlibgit2-a21bb1aa33e9887c06852db62526895df6091736.tar.gz
Merge remote-tracking branch 'source/development' into development
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 783a36eb8..04aaec3df 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -144,8 +144,9 @@ int git_buf_puts(git_buf *buf, const char *string)
int git_buf_vprintf(git_buf *buf, const char *format, va_list ap)
{
int len;
+ const size_t expected_size = buf->size + (strlen(format) * 2);
- ENSURE_SIZE(buf, buf->size + (strlen(format) * 2));
+ ENSURE_SIZE(buf, expected_size);
while (1) {
va_list args;