minor changes for this devlog. spent way more time than is reasonable thinking of the best way to deal with allocation failures… it seems like everyone online has a different opinion on it. I tried doing it “properly” before seeing how many lines of checks that would require for a codepath that would realistically never get hit, so I gave up and just did xmalloc (basically, a wrapper around malloc that exits with an error message when it fails).
Also in the theme of error handling, I did a sweep of the code and wrapped (most) of the io functions I missed to check for failure. it seems like overkill… there has to be a better way but maybe this is how it is.
Finally, I switched from libpcre2 to posix regex.h. I didn’t realize POSIX had a regex.h and it’s way more than is required for this use-case (matching mimetypes).
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.