resurrecting-open-source-projects / scrot

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

--note: loose parsing of color #237

Closed guijan closed 1 year ago

guijan commented 1 year ago

Consider the following invocation:

$ scrot -n "-f '/usr/share/fonts/TTF/DroidSans-Bold/40' -c 255,255,,,,,,,,,,,,,,,,,255 -t 'Hi'"

Notice the many commas in the argument to -c. That should cause an error, but it seems the --note option incorrectly treats the block of commas as a single separator.

I noticed this while working on #206 but back then I didn't quite understand the bug and already had my hands full.

I don't really like note-taking in scrot, both the code and the feature from its presence to the syntax it uses.

N-R-K commented 1 year ago

If I had to guess, it's probably due to using strtok (or similar). Not ideal, but it's pretty harmless. Don't think it's worth fixing.