--- psiconv/trunk/program/extra/rewrite.c 2000/12/25 22:25:33 79 +++ psiconv/trunk/program/extra/rewrite.c 2002/01/29 18:49:12 144 @@ -28,6 +28,8 @@ psiconv_buffer buf; psiconv_file psionfile; + /* psiconv_verbosity = PSICONV_VERB_DEBUG; */ + if (argc < 3) { fprintf(stderr,"Not enough arguments\n"); exit(1); @@ -36,7 +38,7 @@ perror("Can't open file"); exit(1); } - if (!(buf=psiconv_buffer_new(0))) { + if (!(buf=psiconv_buffer_new())) { perror("Can't allocate buf"); exit(1); } @@ -49,12 +51,14 @@ fprintf(stderr,"Parse error\n"); exit(1); } + psiconv_buffer_free(buf); buf = NULL; if (psiconv_write(&buf,psionfile)) { - fprintf(stderr,"Parse error\n"); + fprintf(stderr,"Generate error\n"); exit(1); } + psiconv_free_file(psionfile); if (!(fp = fopen(argv[2],"w"))) { perror("Can't open file"); exit(1); @@ -63,5 +67,7 @@ perror("Can't fwrite file"); exit(1); } + fclose(fp); + psiconv_buffer_free(buf); exit(0); }