This commit is contained in:
Your Name 2023-10-17 16:01:25 +03:00
parent ae75be2088
commit 6ec5c94969

View File

@ -108,16 +108,10 @@ int cptree(const char *src, const char *dst) {
}
int main(const int argc, const char **argv) {
int i;
for (i = 1; i < argc; i++) {
if (argv[i][0] != '-')
break;
else if (!strcmp(argv[i], "-h")) {
printf("cp [Src] [Dst]\n");
return 0;
}
if (argc < 2 || !strcmp(argv[1], "-h")) {
printf("cp [Src] [Dst]\n");
return 0;
}
return cptree(argv[i], argv[argc - 1]);
return cptree(argv[1], argv[2]);
}