[PATCH] splice-out: fix argv[] indexing for output file name
authorJens Axboe <axboe@suse.de>
Sun, 30 Apr 2006 12:28:38 +0000 (14:28 +0200)
committerJens Axboe <axboe@suse.de>
Sun, 30 Apr 2006 12:28:38 +0000 (14:28 +0200)
splice-out.c

index fe62b5191f32961c4a11af2d4edb3e4424db9b1b..c96c5c3c3dde9f5e48819bcf44d0226dfd31d4ee 100644 (file)
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
        if (index == -1 || index + 1 > argc)
                return usage(argv[0]);
 
-       fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
+       fd = open(argv[index], O_WRONLY | O_CREAT | O_TRUNC, 0644);
        if (fd < 0)
                return error("open");