--- psiconv/trunk/lib/psiconv/generate_driver.c 2000/12/24 16:03:57 73 +++ psiconv/trunk/lib/psiconv/generate_driver.c 2000/12/25 00:26:53 76 @@ -28,18 +28,14 @@ int psiconv_write(psiconv_buffer *buf,const psiconv_file value) { - int allocated = 0; int res; if (!value) { psiconv_warn(0,0,"Can't parse to an empty buffer!"); return -PSICONV_E_OTHER; } - if (!*buf) { - if (!(*buf = psiconv_new_buffer())) - return -PSICONV_E_NOMEM; - allocated = 1; - } + if (!(*buf = psiconv_new_buffer())) + return -PSICONV_E_NOMEM; #if 0 if (value->type == psiconv_word_file) { @@ -73,8 +69,7 @@ return -PSICONV_E_OK; ERROR: - if (allocated) - psiconv_free_buffer(*buf); + psiconv_free_buffer(*buf); return res; } @@ -124,7 +119,7 @@ entry->id = PSICONV_ID_APPL_ID_SECTION; entry->offset = psiconv_list_length(extra_buf) + 0x14; - if ((res = psiconv_list_add(section_table,&entry))) + if ((res = psiconv_list_add(section_table,entry))) goto ERROR6; if ((res=psiconv_write_application_id_section(extra_buf, PSICONV_ID_TEXTED,"TextEd.app"))) @@ -132,14 +127,14 @@ entry->id = PSICONV_ID_PAGE_LAYOUT_SECTION; entry->offset = psiconv_list_length(extra_buf) + 0x14; - if ((res = psiconv_list_add(section_table,&entry))) + if ((res = psiconv_list_add(section_table,entry))) goto ERROR6; if ((res = psiconv_write_page_layout_section(extra_buf,value->page_sec))) goto ERROR6; entry->id = PSICONV_ID_TEXTED; entry->offset = psiconv_list_length(extra_buf) + 0x14; - if ((res = psiconv_list_add(section_table,&entry))) + if ((res = psiconv_list_add(section_table,entry))) goto ERROR6; if ((res = psiconv_write_texted_section(extra_buf,value->texted_sec, base_char,base_para)))