- assert(newerrc > 0 && newerrv != NULL);
- if(cerrlist == NULL) {
- p = cerrlist = malloc_chk(sizeof(CERRLIST), "cerrlist");
- } else {
- for(p = cerrlist; p != NULL; p = p->next) {
- q = p;
+ assert(cerrc > 0 && cerrv != NULL);
+ for(int i = 0; i < cerrc; i++) {
+ if(p == NULL) {
+ stat = p = malloc_chk(sizeof(CERRLIST), "cerrlist");
+ } else {
+ p = p->next = malloc_chk(sizeof(CERRLIST), "cerrlist->next");