768db4f5ca
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> |
||
---|---|---|
.. | ||
64bit_div.c | ||
Makefile.inc | ||
args.c | ||
console.c | ||
coreboot.c | ||
ctype.c | ||
die.c | ||
exec.c | ||
fmap.c | ||
getopt_long.c | ||
hexdump.c | ||
ipchecksum.c | ||
lib.c | ||
libgcc.c | ||
malloc.c | ||
memory.c | ||
printf.c | ||
qsort.c | ||
rand.c | ||
readline.c | ||
string.c | ||
strlcpy.c | ||
sysinfo.c | ||
time.c |