gitweb: link to patch(es) view in commit(diff) and (short)log view
[gitweb.git] / hash-object.c
index a4d127cf78013ca43339c5493b7f7ef90b2145a8..846e91a23126b747fbea8d9a8511f708c3d70e43 100644 (file)
@@ -34,10 +34,8 @@ static void hash_object(const char *path, const char *type, int write_object,
 
 static void hash_stdin_paths(const char *type, int write_objects)
 {
-       struct strbuf buf, nbuf;
+       struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
 
-       strbuf_init(&buf, 0);
-       strbuf_init(&nbuf, 0);
        while (strbuf_getline(&buf, stdin, '\n') != EOF) {
                if (buf.buf[0] == '"') {
                        strbuf_reset(&nbuf);
@@ -112,7 +110,7 @@ int main(int argc, const char **argv)
        }
 
        if (errstr) {
-               error (errstr);
+               error("%s", errstr);
                usage_with_options(hash_object_usage, hash_object_options);
        }