Fixed bug where git__source_printf needs multiple attempts
diff --git a/src/object.c b/src/object.c
index 87e1b6e..43698d2 100644
--- a/src/object.c
+++ b/src/object.c
@@ -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;