coreboot-kgpe-d16/payloads/libpayload/libc
Julius Werner 0de2fa0a62 libpayload: Deduplicate strtol and strtoull
Our strtol() and strtoull() function contain almost exactly the same
code. This is a) bad in general and b) may cause the code to get out of
sync, such as it recently happened with CB:32029.

This patch changes strtol() to be based on strtoull() so that the main
parsing code exists only once, and also adds a strtoll() to round off
the library. Also fix the bounds imposed by strtoul() to be based on the
actual length of a 'long', not hardcoded to 32-bits (which is not
equivalent on all architectures).

Change-Id: I919c65a773cecdb11739c3f22dd0d182ed50c07f
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32086
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-04-10 10:44:31 +00:00
..
64bit_div.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
Makefile.inc libpayload: Add support for handling fmaps 2015-07-14 18:12:06 +02:00
args.c
console.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
coreboot.c vboot: make vboot workbuf available to payload 2019-03-19 21:43:02 +00:00
ctype.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
die.c
exec.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
fmap.c libpayload: Add support for handling fmaps 2015-07-14 18:12:06 +02:00
getopt_long.c
hexdump.c
ipchecksum.c
lib.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
libgcc.c lib: Unify log2() and related functions 2015-06-05 13:18:55 +02:00
malloc.c libpayload: Fix CONFIG_LP_DEBUG_MALLOC for 64-bit archs 2019-04-10 10:42:45 +00:00
memory.c libpayload: add memchr to libc 2019-02-11 23:17:37 +00:00
printf.c
qsort.c
rand.c
readline.c
string.c libpayload: Deduplicate strtol and strtoull 2019-04-10 10:44:31 +00:00
strlcpy.c
sysinfo.c
time.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00