filter-branch: remove an unnecessary use of 'git read-tree'
[gitweb.git] / builtin-stripspace.c
index c0b21301ba4c126a49ed38b6983756b99a25aae0..1fd2205d530ad510a18ff5a441ca7b5cb1cc34a6 100644 (file)
@@ -70,16 +70,15 @@ void stripspace(struct strbuf *sb, int skip_comments)
 
 int cmd_stripspace(int argc, const char **argv, const char *prefix)
 {
-       struct strbuf buf;
+       struct strbuf buf = STRBUF_INIT;
        int strip_comments = 0;
 
        if (argc > 1 && (!strcmp(argv[1], "-s") ||
                                !strcmp(argv[1], "--strip-comments")))
                strip_comments = 1;
 
-       strbuf_init(&buf, 0);
        if (strbuf_read(&buf, 0, 1024) < 0)
-               die("could not read the input");
+               die_errno("could not read the input");
 
        stripspace(&buf, strip_comments);