diff options
author | Sean Anderson <seanga2@gmail.com> | 2021-03-11 00:15:42 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-04-12 17:44:55 -0400 |
commit | 9af869c4145a668b6db9accdea554eb57895a25e (patch) | |
tree | e37d12c248da4ec31b1569e1973598b924bb818b /include/linux | |
parent | d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 (diff) | |
download | u-boot-9af869c4145a668b6db9accdea554eb57895a25e.tar.gz u-boot-9af869c4145a668b6db9accdea554eb57895a25e.tar.xz u-boot-9af869c4145a668b6db9accdea554eb57895a25e.zip |
lib: string: Implement strlcat
This introduces strlcat, which provides a safer interface than strncat. It
never copies more than its size bytes, including the terminating nul. In
addition, it never reads past dest[size - 1], even if dest is not
nul-terminated.
This also removes the stub for dwc3 now that we have a proper
implementation.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/string.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index d67998e5c4..dd255f2163 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -35,6 +35,9 @@ extern char * strcat(char *, const char *); #ifndef __HAVE_ARCH_STRNCAT extern char * strncat(char *, const char *, __kernel_size_t); #endif +#ifndef __HAVE_ARCH_STRLCAT +size_t strlcat(char *, const char *, size_t); +#endif #ifndef __HAVE_ARCH_STRCMP extern int strcmp(const char *,const char *); #endif |