BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
struct cmd_set **cmd_set;
struct conn_struct_tos *c = NULL;
struct vfs_state *vfs;
+ int opt;
int i;
char *filename = NULL;
char *cwd = NULL;
exit(1);
}
- while(poptGetNextOpt(pc) != -1);
-
+ while ((opt = poptGetNextOpt(pc)) != -1) {
+ switch (opt) {
+ case POPT_ERROR_BADOPT:
+ fprintf(stderr, "\nInvalid option %s: %s\n\n",
+ poptBadOption(pc, 0), poptStrerror(opt));
+ poptPrintUsage(pc, stderr, 0);
+ exit(1);
+ }
+ }
poptFreeContext(pc);