--- psiconv/trunk/program/psiconv/gen_txt.c 2000/10/04 19:02:04 52 +++ psiconv/trunk/program/psiconv/gen_txt.c 2000/10/21 00:49:13 53 @@ -145,17 +145,22 @@ } } -static int psiconv_gen_txt(FILE * of, const psiconv_file file, +static int psiconv_gen_txt(const char *filename, const psiconv_file file, const char *dest) { + FILE *of = fopen(filename,"w"); + if (! of) + return -1; + if (file->type == psiconv_word_file) { psiconv_gen_txt_word(of,(psiconv_word_f) file->file); - return 0; } else if (file->type == psiconv_texted_file) { psiconv_gen_txt_texted(of,(psiconv_texted_f) file->file); - return 0; - } else - return 1; + } else { + fclose(of); + return -1; + } + return fclose(of); } static struct psiconv_fileformat ff =