commit | 47d4be12c3997343e436c6cca89aefbbbeb70863 | [log] [tgz] |
---|---|---|
author | Paolo Bonzini <pbonzini@redhat.com> | Thu Sep 10 10:02:00 2015 +0200 |
committer | Paolo Bonzini <pbonzini@redhat.com> | Thu Sep 10 10:02:00 2015 +0200 |
tree | a4edcff0049477f2a63a375f29263f4d222d8696 | |
parent | 9fd1a94888cd6a559f95c3596ec1ac28b74838c1 [diff] |
cutils: work around platform differences in strto{l,ul,ll,ull} Linux returns 0 if no conversion was made, while OS X and presumably the BSDs return EINVAL. The OS X convention rejects more invalid inputs, so convert to it and adjust the test case. Windows returns 1 from strtoul and strtoull (instead of -1) for negative out-of-range input; fix it up. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>