summaryrefslogtreecommitdiff
path: root/libgcompat/string.c
diff options
context:
space:
mode:
authorLassebq <lassebq.mine@gmail.com>2024-05-10 22:17:52 +0300
committerAnna Wilcox <awilcox@wilcox-tech.com>2024-10-22 18:51:15 +0000
commit785d71e5ba6498e38e974080c99ed853923ba815 (patch)
treea53857a80918027583c367d1b79e3910a2c99d0f /libgcompat/string.c
parent73b40546d59c6bebd782aeaa15a6bdc8109485bd (diff)
downloadgcompat-785d71e5ba6498e38e974080c99ed853923ba815.tar.gz
gcompat-785d71e5ba6498e38e974080c99ed853923ba815.tar.bz2
gcompat-785d71e5ba6498e38e974080c99ed853923ba815.tar.xz
gcompat-785d71e5ba6498e38e974080c99ed853923ba815.zip
string: change behavior of __strncat_chk
Diffstat (limited to 'libgcompat/string.c')
-rw-r--r--libgcompat/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgcompat/string.c b/libgcompat/string.c
index a164ab2..162d94c 100644
--- a/libgcompat/string.c
+++ b/libgcompat/string.c
@@ -247,7 +247,7 @@ char *__strncat_chk(char *dest, const char *src, size_t n, size_t destlen)
assert(dest != NULL);
assert(src != NULL);
- total = strnlen(dest, destlen) + n + 1;
+ total = strnlen(dest, destlen) + strnlen(src, destlen) + 1;
assert(destlen >= total);
if (dest < src) {
assert(dest + total <= src);