--- psiconv/trunk/lib/psiconv/generate_texted.c 2004/02/04 12:19:09 196 +++ psiconv/trunk/lib/psiconv/generate_texted.c 2004/02/26 16:27:43 233 @@ -44,18 +44,22 @@ psiconv_progress(config,lev,0,"Writing texted section"); if (!value) { - psiconv_error(config,0,psiconv_buffer_length(buf),"Null TextEd section"); + psiconv_error(config,lev,0,"Null TextEd section"); res = -PSICONV_E_GENERATE; goto ERROR1; } if (!(*extra_buf = psiconv_buffer_new())) { + psiconv_error(config,lev+1,0,"Out of memory error"); res = -PSICONV_E_NOMEM; goto ERROR1; } layout_id = psiconv_buffer_unique_id(); - psiconv_buffer_add_target(*extra_buf,layout_id); + if ((res = psiconv_buffer_add_target(*extra_buf,layout_id))) { + psiconv_error(config,lev+1,0,"Out of memory error"); + goto ERROR2; + } if (psiconv_list_length(value->paragraphs)) { with_layout_section = 1; @@ -90,10 +94,14 @@ if ((res = psiconv_write_u32(config,buf,lev+1,PSICONV_ID_TEXTED_TEXT))) goto ERROR2; - return psiconv_write_text_section(config,buf,lev+1,value->paragraphs); + if ((res = psiconv_write_text_section(config,buf,lev+1,value->paragraphs))) + goto ERROR2; + psiconv_progress(config,lev,0,"End of texted section"); + return 0; ERROR2: psiconv_buffer_free(*extra_buf); ERROR1: + psiconv_error(config,lev,0,"Writing of texted section failed"); return res; }