]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/string/strcpy/strncat.[ch]: STRNCAT(): Add macro
authorAlejandro Colomar <alx@kernel.org>
Tue, 21 May 2024 10:50:27 +0000 (12:50 +0200)
committerSerge Hallyn <serge@hallyn.com>
Tue, 2 Jul 2024 02:40:11 +0000 (21:40 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/string/strcpy/strncat.c [new file with mode: 0644]
lib/string/strcpy/strncat.h [new file with mode: 0644]

index aaee71672e93e3a017f3a53207d57249175ae811..21900733e3e62d787e54ab57ff6d6a44127628cb 100644 (file)
@@ -152,6 +152,8 @@ libshadow_la_SOURCES = \
        string/sprintf/xasprintf.h \
        string/strcpy/stpecpy.c \
        string/strcpy/stpecpy.h \
+       string/strcpy/strncat.c \
+       string/strcpy/strncat.h \
        string/strcpy/strncpy.c \
        string/strcpy/strncpy.h \
        string/strcpy/strtcpy.c \
diff --git a/lib/string/strcpy/strncat.c b/lib/string/strcpy/strncat.c
new file mode 100644 (file)
index 0000000..d55f172
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#include <config.h>
+
+#include "string/strcpy/strncat.h"
diff --git a/lib/string/strcpy/strncat.h b/lib/string/strcpy/strncat.h
new file mode 100644 (file)
index 0000000..6bb9907
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCAT_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCAT_H_
+
+
+#include <config.h>
+
+#include <string.h>
+
+#include "sizeof.h"
+
+
+#define STRNCAT(dst, src)  strncat(dst, src, NITEMS(src))
+
+
+#endif  // include guard