]> git.proxmox.com Git - mirror_qemu.git/commit - util/cutils.c
utils: Work around mingw strto*l bug with 0x
authorEric Blake <eblake@redhat.com>
Tue, 23 Mar 2021 16:53:00 +0000 (16:53 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 24 Mar 2021 14:25:41 +0000 (14:25 +0000)
commit6162f7dafef51b44c5700ac3f82ff682faafe6c2
treee2800a51427d5ce25c336344a2db229cb55b956b
parent061d79097c080722e359db7c0d9cddc006cfb14d
utils: Work around mingw strto*l bug with 0x

Mingw recognizes that "0x" has value 0 without setting errno, but
fails to advance endptr to the trailing garbage 'x'.  This in turn
showed up in our recent testsuite additions for qemu_strtosz (commit
1657ba44b4 utils: Enhance testsuite for do_strtosz()); adjust our
remaining tests to show that we now work around this windows bug.

This patch intentionally fails check-syntax for use of strtol.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210317143325.2165821-3-eblake@redhat.com>
Message-Id: <20210323165308.15244-15-alex.bennee@linaro.org>
tests/unit/test-cutils.c
util/cutils.c