/[public]/psiconv/trunk/lib/psiconv/generate_common.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/generate_common.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 75 Revision 76
49 if (!value) { 49 if (!value) {
50 psiconv_warn(0,psiconv_list_length(buf),"Null section table section"); 50 psiconv_warn(0,psiconv_list_length(buf),"Null section table section");
51 return -PSICONV_E_GENERATE; 51 return -PSICONV_E_GENERATE;
52 } 52 }
53 53
54 if (!(entry = malloc(sizeof(*entry))))
55 return -PSICONV_E_NOMEM;
56
57 if ((res = psiconv_write_u8(buf,2 * sizeof(psiconv_u32) * 54 if ((res = psiconv_write_u8(buf,2 * psiconv_list_length(value))))
58 psiconv_list_length(value)))) 55 return res;
59 goto ERROR;
60 for (i = 0; i < psiconv_list_length(value); i++) { 56 for (i = 0; i < psiconv_list_length(value); i++) {
61 if (!(entry = psiconv_list_get(value,i))) { 57 if (!(entry = psiconv_list_get(value,i))) {
62 psiconv_warn(0,psiconv_list_length(buf),"Massive memory corruption"); 58 psiconv_warn(0,psiconv_list_length(buf),"Massive memory corruption");
63 res = -PSICONV_E_NOMEM; 59 return -PSICONV_E_NOMEM;
64 goto ERROR;
65 } 60 }
66 if ((res = psiconv_write_u32(buf,entry->id))) 61 if ((res = psiconv_write_u32(buf,entry->id)))
67 goto ERROR; 62 return res;
68 if ((res = psiconv_write_u32(buf,entry->offset))) 63 if ((res = psiconv_write_u32(buf,entry->offset)))
69 goto ERROR; 64 return res;
70 } 65 }
71 res = -PSICONV_E_OK; 66 return -PSICONV_E_OK;
72ERROR:
73 free(entry);
74 return res;
75} 67}
76 68
77int psiconv_write_application_id_section(psiconv_buffer buf,psiconv_u32 id, 69int psiconv_write_application_id_section(psiconv_buffer buf,psiconv_u32 id,
78 const psiconv_string_t text) 70 const psiconv_string_t text)
79{ 71{

Legend:
Removed from v.75  
changed lines
  Added in v.76

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26