resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
495 stars 49 forks source link

remove dubious errno usage #334

Closed N-R-K closed 1 year ago

N-R-K commented 1 year ago

standard library functions are allowed to change errno even on success and thus setting errno to 0 before calling something typically doesn't do much (with exceptions such as strtoll() where it's documented recommendation to set errno to 0 before calling).

saving and restoring errno is typically done inside non-fatal signal handlers so that the resuming code isn't impacted by the clobbered errno. no reason to do it in a string to integer conversion routine.

also fix a small indentation issue.