git: libc - Correct handling of non-hex sequences in strtol*() and related

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Jul 13 09:11:12 PDT 2022


commit 213582ebfc4fb70c430b219aa0afbc9141d27d24
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Jul 13 09:07:12 2022 -0700

    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

Summary of changes:
 lib/libc/citrus/_strtol.h            | 5 ++++-
 lib/libc/citrus/_strtoul.h           | 5 ++++-
 lib/libc/citrus/citrus_bcs_strtol.c  | 3 +++
 lib/libc/citrus/citrus_bcs_strtoul.c | 3 +++
 lib/libc/locale/wcstoimax.c          | 5 ++++-
 lib/libc/locale/wcstol.c             | 5 ++++-
 lib/libc/locale/wcstoll.c            | 5 ++++-
 lib/libc/locale/wcstoul.c            | 5 ++++-
 lib/libc/locale/wcstoull.c           | 5 ++++-
 lib/libc/locale/wcstoumax.c          | 5 ++++-
 lib/libc/stdlib/_strtol.h            | 5 ++++-
 lib/libc/stdlib/_strtoul.h           | 5 ++++-
 12 files changed, 46 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/213582ebfc4fb70c430b219aa0afbc9141d27d24


-- 
DragonFly BSD source repository


More information about the Commits mailing list