resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
512 stars 51 forks source link

use `ecalloc()`, `estrdup()`, etc from the NetBSD base system #230

Closed guijan closed 1 year ago

guijan commented 1 year ago

NetBSD has these functions with the semantics we want in a library in its base system: https://man.netbsd.org/ecalloc.3

We could put the logic in the build system to use the system's version of these functions (and any others we introduce) if they exist, or fall back to our own implementation otherwise. This would save some file size on NetBSD.

N-R-K commented 1 year ago

These are some very trivial wrappers, I don't think there's much point in trying to check for them.

And from past experience, I've seen these type of checks often be sources of subtle bugs. Similar to #ifdefs, they create a combinatoric explosion of 2n possible builds, which nobody obviously tests exhaustively.