resurrecting-open-source-projects / scrot

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

incorrect imlib error handling #243

Closed guijan closed 1 year ago

guijan commented 1 year ago

If you look at this function call: https://github.com/resurrecting-open-source-projects/scrot/blob/e332c8b3982d53f6c5a26f0550ed80cb2796a807/src/scrot.c#L158-L160 That imlib function can error for reasons that don't involve errno, as the Imlib_Load_Error type (the 2nd parameter of imlib_save_image_with_error_return()) conveys. We need to avoid printing the error message associated with the value of errno in that case.

This isn't the first time this kind of issue appears, the same bug has been fixed elsewhere in #217. There are probably other instances, this needs investigation.

N-R-K commented 1 year ago

I think we should (eventually) switch to imlib_get_error() and imlib_strerror().

This will require a minimum version bump, though. Which I'd be okay with if the minimum version we're going for is available in debian stable (since is one of the slower distros around).