The codebase makes a lot of use of the following pattern, where allocations are just asserted to have succeeded:
char* CLEANUP_STR parent_backing = strdup(val);
assert(parent_backing != NULL);
I could totally have a strdup_checked or maybe strdup_c function (and equivalents for realloc and calloc and malloc etc etc) to not repeat myself.
The codebase makes a lot of use of the following pattern, where allocations are just asserted to have succeeded:
I could totally have a
strdup_checkedor maybestrdup_cfunction (and equivalents forreallocandcallocandmallocetc etc) to not repeat myself.