| … | |
… | |
| 56 | buf = NULL; |
56 | buf = NULL; |
| 57 | if (psiconv_write(&buf,psionfile)) { |
57 | if (psiconv_write(&buf,psionfile)) { |
| 58 | fprintf(stderr,"Generate error\n"); |
58 | fprintf(stderr,"Generate error\n"); |
| 59 | exit(1); |
59 | exit(1); |
| 60 | } |
60 | } |
|
|
61 | psiconv_free_file(psionfile); |
| 61 | if (!(fp = fopen(argv[2],"w"))) { |
62 | if (!(fp = fopen(argv[2],"w"))) { |
| 62 | perror("Can't open file"); |
63 | perror("Can't open file"); |
| 63 | exit(1); |
64 | exit(1); |
| 64 | } |
65 | } |
| 65 | if ((psiconv_buffer_fwrite_all(buf,fp))) { |
66 | if ((psiconv_buffer_fwrite_all(buf,fp))) { |
| 66 | perror("Can't fwrite file"); |
67 | perror("Can't fwrite file"); |
| 67 | exit(1); |
68 | exit(1); |
| 68 | } |
69 | } |
|
|
70 | fclose(fp); |
|
|
71 | psiconv_buffer_free(buf); |
| 69 | exit(0); |
72 | exit(0); |
| 70 | } |
73 | } |