evanpacini / netpbm-c

Some headers and experiments with netpbm and C.
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

refactor: prevent future bugs #19

Open evanpacini opened 1 year ago

evanpacini commented 1 year ago

Error handling is not implemented properly everywhere. While memory allocation errors are always logged and return NULL, the functions that actually use them don't necessarily handle NULL properly.

evanpacini commented 1 year ago

I am actually unsure whether I should implement each function to have pre-condition checks or have the user check for those.

KaspervanM commented 1 year ago

I am keen to say having pre-condition checks is best, but I think that depends on how they would be used in the end. If only another interface (for the python program) interacts with the functions, then perhaps having that interface deal with the pre- and post-condition checks is preferable.