Merge branch 'kn/for-each-branch'
[gitweb.git] / builtin / upload-archive.c
index 32ab94cd06b43cd05316f9a16981adc883c0d066..dbfe14f3fec3f8122e4855727bd7d1c3e4b3073e 100644 (file)
@@ -49,15 +49,14 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
 __attribute__((format (printf, 1, 2)))
 static void error_clnt(const char *fmt, ...)
 {
-       char buf[1024];
+       struct strbuf buf = STRBUF_INIT;
        va_list params;
-       int len;
 
        va_start(params, fmt);
-       len = vsprintf(buf, fmt, params);
+       strbuf_vaddf(&buf, fmt, params);
        va_end(params);
-       send_sideband(1, 3, buflen, LARGE_PACKET_MAX);
-       die("sent error to the client: %s", buf);
+       send_sideband(1, 3, buf.buf, buf.len, LARGE_PACKET_MAX);
+       die("sent error to the client: %s", buf.buf);
 }
 
 static ssize_t process_input(int child_fd, int band)