Fix crash with '-' stdin input
authorJens Axboe <jens.axboe@oracle.com>
Wed, 16 May 2007 09:02:18 +0000 (11:02 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 16 May 2007 09:02:18 +0000 (11:02 +0200)
Need to use argv[optind], not optarg.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
blkparse.c

index cdcb426803ebd603e9a958fb4944f4d1f53a2a58..3557aaac0610e35b66caae0fcb5a6c1c74eaf0db 100644 (file)
@@ -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++;