libc - Correct handling of non-hex sequences in strtol*() and related
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 13 Jul 2022 16:07:12 +0000 (09:07 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 13 Jul 2022 16:07:12 +0000 (09:07 -0700)
commit213582ebfc4fb70c430b219aa0afbc9141d27d24
treedc66c4da1824a6f3dfb9e230a964e4615a82cf99
parentf50a4783ced76e1cc7d8009aa3a1f10eb4a3bef9
libc - Correct handling of non-hex sequences in strtol*() and related

* The standard clarifies that non-hex sequences such as "0xy"
  should return 0 and a pointer to "xy".  Ours was returning
  0 and a pointer to "y".  Fixed.

* Unlikely to be any net effect on code other than improved
  standards conformity.

Reported-by: Herbert J. Skuhra
12 files changed:
lib/libc/citrus/_strtol.h
lib/libc/citrus/_strtoul.h
lib/libc/citrus/citrus_bcs_strtol.c
lib/libc/citrus/citrus_bcs_strtoul.c
lib/libc/locale/wcstoimax.c
lib/libc/locale/wcstol.c
lib/libc/locale/wcstoll.c
lib/libc/locale/wcstoul.c
lib/libc/locale/wcstoull.c
lib/libc/locale/wcstoumax.c
lib/libc/stdlib/_strtol.h
lib/libc/stdlib/_strtoul.h