[PATCH xrandr v4 2/5] xrandr: stricter --scale argument parsing
Giuseppe Bilotta
giuseppe.bilotta at gmail.com
Tue Feb 6 08:58:46 UTC 2018
On Tue, Feb 6, 2018 at 3:43 AM, Keith Packard <keithp at keithp.com> wrote:
> No, strtod requires a non-empty sequence of digits.
Woah. My whole life is a lie …
(I guess it's my fault for never bothering to actually verify this.)
> strtod is actually not a terrible function (surprising for libc, I know)
You know there's something wrong with a library when an X.org
developer questions its general sanity ;-)
Joking aside, this does mean that strtod could be a good option when
parsing the single value. The check would be more verbose though, so I
think I'll stick with sscanf.
I'll add the positive check for both scale and gamma and respin the patch.
--
Giuseppe "Oblomov" Bilotta
More information about the xorg-devel
mailing list