mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 20:23:01 +02:00
bin: copy: fix segfault for one argument
The code assumes both SRC and DST is passed, here we ensure this early. Prior to this patch: root@host:~$ copy foo Segmentation fault (core dumped) Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
+1
-1
@@ -418,7 +418,7 @@ int main(int argc, char *argv[])
|
||||
if (timeout < 0)
|
||||
timeout = 120;
|
||||
|
||||
if (optind >= argc)
|
||||
if (argc - optind != 2)
|
||||
return usage(1);
|
||||
|
||||
src = argv[optind++];
|
||||
|
||||
Reference in New Issue
Block a user