diff options
-rw-r--r-- | plpfuse/main.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plpfuse/main.cc b/plpfuse/main.cc index 5ff2f78..07564a0 100644 --- a/plpfuse/main.cc +++ b/plpfuse/main.cc @@ -440,11 +440,13 @@ int main(int argc, char**argv) { break; case 'p': parse_destination(optarg, &host, &sockNum); - for (i = oldoptind; i < argc - (optind - oldoptind); i++) - argv[i] = argv[i + (optind - oldoptind)]; argc -= optind - oldoptind; + for (i = oldoptind; i < argc; i++) + argv[i] = argv[i + (optind - oldoptind)]; break; } + if (optind >= argc) + break; } skt = new ppsocket(); |