diff options
Diffstat (limited to 'cmd-switch-client.c')
-rw-r--r-- | cmd-switch-client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-switch-client.c b/cmd-switch-client.c index 9ff1c081..03cb7c8d 100644 --- a/cmd-switch-client.c +++ b/cmd-switch-client.c @@ -61,10 +61,12 @@ cmd_switch_client_parse(struct cmd *self, int argc, char **argv, char **cause) while ((opt = getopt(argc, argv, "c:t:")) != -1) { switch (opt) { case 'c': - data->name = xstrdup(optarg); + if (data->name == NULL) + data->name = xstrdup(optarg); break; case 't': - data->target = xstrdup(optarg); + if (data->target == NULL) + data->target = xstrdup(optarg); break; default: goto usage; |