summaryrefslogtreecommitdiffstats
path: root/usr.bin/ncal
diff options
context:
space:
mode:
authorvangyzen <vangyzen@FreeBSD.org>2016-11-30 20:47:54 +0000
committervangyzen <vangyzen@FreeBSD.org>2016-11-30 20:47:54 +0000
commit9f0bb5b88e4e6e110736f59959233868a8eadbcc (patch)
treea8bbf8fe373cb21f8fc1aaf1dee185b77b18e4e9 /usr.bin/ncal
parentc58c8b43cb4b9c7114991d72f311d01b1d9b36e6 (diff)
downloadFreeBSD-src-9f0bb5b88e4e6e110736f59959233868a8eadbcc.zip
FreeBSD-src-9f0bb5b88e4e6e110736f59959233868a8eadbcc.tar.gz
MFC r308904
Fix error reporting from wcstof() When wcstof() skipped initial space and then parsing failed, it set endptr to the first non-space character. Fix it to correctly report failure by setting endptr to the beginning of the input string. The fix is from theraven@, who fixed this bug in wcstod() and wcstold() in r227753. While I'm here: Move assignments out of declarations in wcstod() and wcstold(). This is against my personal preference, but it is our agreed style(9). Set endptr correctly on malloc() failure in all three functions. Remove an incorrect comment: This is pointer arithmetic, so the code was not actually making that assumption. wcstold() advanced the wcp pointer beyond leading whitespace and then reset it back to the beginning of the string. Do not reset it. This seems to have no functional effect, since strtold_l() also skips leading whitespace. I'm making the change to keep this function consistent with wcstof() and wcstod(), and because the C11 spec prescribes the use of iswspace() to skip leading space. Reported by: libc++ unit test for std::stof(std::wstring) Sponsored by: Dell EMC
Diffstat (limited to 'usr.bin/ncal')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud