summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-05 09:00:09 +0200
committerVicent Marti <tanoku@gmail.com>2011-02-05 09:01:10 +0200
commit5d773a6ee8542a5eaf94c34efcd27124c78e0bc7 (patch)
tree64bafc8932bfe5d8794ccd97e301ebb0dd7aaadd /src/object.c
parentddc9e79ae2acf6afa9262909649b2984e1b3ff1a (diff)
parent35786cb7e8d8b06aa211acbc741207d08973920b (diff)
downloadlibgit2-5d773a6ee8542a5eaf94c34efcd27124c78e0bc7.tar.gz
Merge branch 'master' of https://github.com/jwiegley/libgit2
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/object.c b/src/object.c
index 87e1b6eac..dd84cb5d7 100644
--- a/src/object.c
+++ b/src/object.c
@@ -97,7 +97,7 @@ static int source_resize(git_odb_source *src)
int git__source_printf(git_odb_source *source, const char *format, ...)
{
va_list arglist;
- int len, did_resize = 0;
+ int len;
assert(source->open && source->write_ptr);
@@ -109,12 +109,9 @@ int git__source_printf(git_odb_source *source, const char *format, ...)
if (source_resize(source) < GIT_SUCCESS)
return GIT_ENOMEM;
- did_resize = 1;
+ len = vsnprintf(source->write_ptr, source->raw.len - source->written_bytes, format, arglist);
}
- if (did_resize)
- vsnprintf(source->write_ptr, source->raw.len - source->written_bytes, format, arglist);
-
source->write_ptr = (char *)source->write_ptr + len;
source->written_bytes += len;