From: Jens Axboe Date: Wed, 16 May 2007 09:02:18 +0000 (+0200) Subject: Fix crash with '-' stdin input X-Git-Tag: blktrace-0.99.3~13 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=00cd304410a4e750ef929823dca3b932baa797b0;p=blktrace.git Fix crash with '-' stdin input Need to use argv[optind], not optarg. Signed-off-by: Jens Axboe --- diff --git a/blkparse.c b/blkparse.c index cdcb426..3557aaa 100644 --- a/blkparse.c +++ b/blkparse.c @@ -2612,7 +2612,7 @@ int main(int argc, char *argv[]) while (optind < argc) { if (is_pipe(argv[optind]) && !pipeline) { pipeline = 1; - pipename = strdup(optarg); + pipename = strdup(argv[optind]); } else if (resize_devices(argv[optind]) != 0) return 1; optind++;