coreboot-kgpe-d16/payloads/libpayload/libc
Jacob Garber 768db4f5ca libpayload/libc: Correct strlcat return value
The documented return value for strlcat is horribly wrong, as is the
return value itself. It should not return the number of appended bytes,
but rather the length of the concatenated string. From the man page:

    The strlcpy() and strlcat() functions return the total length of the
    string they tried to create. For strlcpy() that means the length of
    src. For strlcat() that means the initial length of dst plus the
    length of src. While this may seem somewhat confusing, it was done
    to make truncation detection simple.

This change is more likely to fix existing code than break it, since
anyone who uses the return value of strlcat will almost certainly rely
on the standard behaviour rather than investigate coreboot's source code
to see that we have a quirky version.

Change-Id: I4421305af85bce88d12d6fdc2eea6807ccdcf449
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33787
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2019-07-23 09:09:32 +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 coreboot_tables: pass the early_mmc_wake_hw status to payload 2019-05-23 09:04:41 +00:00
ctype.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
die.c libpayload: Add a new "die" function to fatally signal programming errors. 2014-09-15 17:37:13 +02:00
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 libpayload: hexdump: Use `p` as conversion specifier for pointers 2014-12-19 21:15:05 +01:00
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 libpayload: Enable -Wimplicit-fallthrough 2019-07-21 17:17:42 +00:00
qsort.c
rand.c
readline.c
string.c libpayload/libc: Correct strlcat return value 2019-07-23 09:09:32 +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