+ 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");
+ }
+ p->cerr = &cerrv[i];
+ p->next = NULL;
+ }
+ p->next = cerrlist;
+ cerrlist = stat;
+}