xx
This commit is contained in:
parent
c7132e6b75
commit
c65dbcfb4a
10
main.c
10
main.c
|
|
@ -36,6 +36,14 @@ int main(int argc, char *argv[]) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *of = malloc(strlen(argv[1])+6);
|
||||||
|
if (of == NULL) {
|
||||||
|
perror("Galat alokasi memori of");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
strcpy(of, argv[1]);
|
||||||
|
strcat(of, ".html");
|
||||||
|
|
||||||
fptr = fopen(argv[1], "rt");
|
fptr = fopen(argv[1], "rt");
|
||||||
if (fptr == NULL) {
|
if (fptr == NULL) {
|
||||||
perror("Galat membuka masukan berkas");
|
perror("Galat membuka masukan berkas");
|
||||||
|
|
@ -43,7 +51,7 @@ int main(int argc, char *argv[]) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fpto = fopen("data.html", "wb");
|
FILE *fpto = fopen(of, "wb");
|
||||||
if (fpto == NULL) {
|
if (fpto == NULL) {
|
||||||
perror("Galat membuat keluaran berkas");
|
perror("Galat membuat keluaran berkas");
|
||||||
fclose(fptr);
|
fclose(fptr);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user