| 1128 | } |
| 1129 | |
| 1130 | static void *ply_grow_array(p_ply ply, void **pointer, |
| 1131 | long *nmemb, long size) { |
| 1132 | void *temp = *pointer; |
| 1133 | long count = *nmemb + 1; |
| 1134 | if (!temp) temp = malloc(count*size); |
| 1135 | else temp = realloc(temp, count*size); |
| 1136 | if (!temp) { |
| 1137 | ply_ferror(ply, "Out of memory"); |
| 1138 | return NULL; |
| 1139 | } |
| 1140 | *pointer = temp; |
| 1141 | *nmemb = count; |
| 1142 | return (char *) temp + (count-1) * size; |
| 1143 | } |
| 1144 | |
| 1145 | static p_ply_element ply_grow_element(p_ply ply) { |
| 1146 | p_ply_element element = NULL; |
no test coverage detected