--- psiconv/trunk/program/psiconv/gen_rtf.c 1999/12/02 18:05:36 36 +++ psiconv/trunk/program/psiconv/gen_rtf.c 2000/10/21 00:49:13 53 @@ -522,16 +522,22 @@ psiconv_list_free(colors); } -static int psiconv_gen_rtf(FILE * of, const psiconv_file file, const char *dest) +static int psiconv_gen_rtf(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_rtf_word(of,(psiconv_word_f) file->file); - return 0; } else if (file->type == psiconv_texted_file) { psiconv_gen_rtf_texted(of,(psiconv_texted_f) file->file); - return 0; - } else + } else { + fclose(of); return -1; + } + return fclose(of); } static struct psiconv_fileformat ff =