X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rev-parse.c;h=81d5a6ffc9ff1c149bfb68f976a9e66c307cae1d;hb=b4955fb611ce407ef0e522862c60ae0472dbfe5e;hp=9aa049ec170b0125fddde29adda3c720c8a7b8ee;hpb=0bb3a0ba9e3cbb283a747e4736bcf7484d076a73;p=git.git diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index 9aa049ec1..81d5a6ffc 100644 --- a/builtin-rev-parse.c +++ b/builtin-rev-parse.c @@ -307,19 +307,17 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix) OPT_END(), }; - struct strbuf sb, parsed; + struct strbuf sb = STRBUF_INIT, parsed = STRBUF_INIT; const char **usage = NULL; struct option *opts = NULL; int onb = 0, osz = 0, unb = 0, usz = 0; - strbuf_init(&parsed, 0); strbuf_addstr(&parsed, "set --"); argc = parse_options(argc, argv, parseopt_opts, parseopt_usage, PARSE_OPT_KEEP_DASHDASH); if (argc < 1 || strcmp(argv[0], "--")) usage_with_options(parseopt_usage, parseopt_opts); - strbuf_init(&sb, 0); /* get the usage up to the first line with a -- on it */ for (;;) { if (strbuf_getline(&sb, stdin, '\n') == EOF)