Skip to content

Commit

Permalink
fix segfault in mirror command (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
rilysh authored Nov 18, 2022
1 parent e9fb6b4 commit 8af7d4e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mport/mport.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,13 @@ main(int argc, char *argv[]) {
resultCode = configSet(mport, argv[2], argv[3]);
}
} else if (!strcmp(cmd, "mirror")) {
if (!strcmp(argv[1], "list")) {
loadIndex(mport);
printf("To set a mirror, use the following command:\n");
printf("mport set config mirror_region <country>\n\n");
resultCode = mport_index_print_mirror_list(mport);
if (argc > 2) {
if (!strcmp(argv[1], "list")) {
loadIndex(mport);
printf("To set a mirror, use the following command:\n");
printf("mport set config mirror_region <country>\n\n");
resultCode = mport_index_print_mirror_list(mport);
}
}
} else if (!strcmp(cmd, "cpe")) {
resultCode = cpeList(mport);
Expand Down

0 comments on commit 8af7d4e

Please sign in to comment.