string/sprintf/stpeprintf.h \
string/sprintf/xasprintf.c \
string/sprintf/xasprintf.h \
- string/stpecpy.c \
- string/stpecpy.h \
+ string/strcpy/stpecpy.c \
+ string/strcpy/stpecpy.h \
+ string/strcpy/strncpy.c \
+ string/strcpy/strncpy.h \
+ string/strcpy/strtcpy.c \
+ string/strcpy/strtcpy.h \
+ string/strcpy/zustr2stp.c \
+ string/strcpy/zustr2stp.h \
string/strftime.c \
string/strftime.h \
- string/strncpy.h \
- string/strtcpy.c \
- string/strtcpy.h \
- string/zustr2stp.h \
strtoday.c \
sub.c \
subordinateio.h \
#include <stdio.h>
#include "getdef.h"
#include "prototypes.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
#ident "$Id$"
#include "memzero.h"
#include "prototypes.h"
#include "string/strftime.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
#define YEAR (365L*DAY)
#include <lastlog.h>
#include "memzero.h"
#include "prototypes.h"
-#include "string/strncpy.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strncpy.h"
+#include "string/strcpy/strtcpy.h"
/*
+++ /dev/null
-/*
- * SPDX-FileCopyrightText: 2022 - 2023, Alejandro Colomar <alx@kernel.org>
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-#include <config.h>
-
-#if !defined(HAVE_STPECPY)
-
-#ident "$Id$"
-
-#include "string/stpecpy.h"
-
-
-extern inline char *stpecpy(char *dst, char *end, const char *restrict src);
-
-
-#endif // !HAVE_STPECPY
--- /dev/null
+// SPDX-FileCopyrightText: 2022-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#include <config.h>
+
+#include "string/strcpy/stpecpy.h"
+
+
+#if !defined(HAVE_STPECPY)
+extern inline char *stpecpy(char *dst, char *end, const char *restrict src);
+#endif
-/*
- * SPDX-FileCopyrightText: 2022 - 2023, Alejandro Colomar <alx@kernel.org>
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
+// SPDX-FileCopyrightText: 2022-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef SHADOW_INCLUDE_LIB_STPECPY_H_
-#define SHADOW_INCLUDE_LIB_STPECPY_H_
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STPECPY_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STPECPY_H_
#include <config.h>
-#if !defined(HAVE_STPECPY)
-
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "attr.h"
+#if !defined(HAVE_STPECPY)
ATTR_STRING(3)
inline char *stpecpy(char *dst, char *end, const char *restrict src);
+#endif
/*
*/
+#if !defined(HAVE_STPECPY)
inline char *
stpecpy(char *dst, char *end, const char *restrict src)
{
return stpcpy(mempcpy(dst, src, dlen), "") + trunc;
}
+#endif
-#endif // !HAVE_STPECPY
#endif // include guard
--- /dev/null
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#include <config.h>
+
+#include "string/strcpy/strncpy.h"
--- /dev/null
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCPY_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCPY_H_
+
+
+#include <config.h>
+
+#include <string.h>
+
+#include "sizeof.h"
+
+
+#define STRNCPY(dst, src) strncpy(dst, src, NITEMS(dst))
+
+
+#endif // include guard
-/*
- * SPDX-FileCopyrightText: 2022-2023, Alejandro Colomar <alx@kernel.org>
- * SPDX-License-Identifier: BSD-3-Clause
- */
+// SPDX-FileCopyrightText: 2022-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
#include <config.h>
#include <stddef.h>
#include <sys/types.h>
-#ident "$Id$"
-
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
extern inline ssize_t strtcpy(char *restrict dst, const char *restrict src,
-/*
- * SPDX-FileCopyrightText: 2023, Alejandro Colomar <alx@kernel.org>
- * SPDX-License-Identifier: BSD-3-Clause
- */
+// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef SHADOW_INCLUDE_LIB_STRTCPY_H_
-#define SHADOW_INCLUDE_LIB_STRTCPY_H_
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STRTCPY_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRTCPY_H_
#include <config.h>
#include <sys/types.h>
#include "attr.h"
-#include "defines.h"
#include "sizeof.h"
#include <config.h>
-#include "string/zustr2stp.h"
+#include "string/strcpy/zustr2stp.h"
// SPDX-License-Identifier: BSD-3-Clause
-#ifndef SHADOW_INCLUDE_LIB_STRING_ZUSTR2STP_H_
-#define SHADOW_INCLUDE_LIB_STRING_ZUSTR2STP_H_
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_ZUSTR2STP_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRCPY_ZUSTR2STP_H_
#include <config.h>
+++ /dev/null
-/*
- * SPDX-FileCopyrightText: 2023, Alejandro Colomar <alx@kernel.org>
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-#ifndef SHADOW_INCLUDE_LIB_STRNCPY_H_
-#define SHADOW_INCLUDE_LIB_STRNCPY_H_
-
-
-#include <config.h>
-
-#include <string.h>
-
-#include "sizeof.h"
-
-
-#define STRNCPY(dst, src) strncpy(dst, src, NITEMS(dst))
-
-
-#endif // include guard
#include "defines.h"
#include "sizeof.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
#define DAY_TO_STR(str, day) day_to_str(NITEMS(str), str, day)
#include "alloc.h"
#include "sizeof.h"
-#include "string/strncpy.h"
-#include "string/strtcpy.h"
-#include "string/zustr2stp.h"
+#include "string/strcpy/strncpy.h"
+#include "string/strcpy/strtcpy.h"
+#include "string/strcpy/zustr2stp.h"
#ident "$Id$"
#include "shadowio.h"
#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
+#include "string/strcpy/strtcpy.h"
#include "string/strftime.h"
-#include "string/strtcpy.h"
#include "time/day_to_str.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "exitcodes.h"
#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
/*
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
#ifndef SHELLS_FILE
#define SHELLS_FILE "/etc/shells"
#define ETCDIR "/etc"
#endif
+
/*
* Global variables
*/
#include "exitcodes.h"
#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
/*
#endif
#include "shadowlog.h"
#include "string/sprintf/stpeprintf.h"
-#include "string/stpecpy.h"
+#include "string/strcpy/stpecpy.h"
/*
#include "exitcodes.h"
#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
+#include "string/strcpy/strtcpy.h"
#include "string/strftime.h"
-#include "string/strtcpy.h"
#ifdef USE_PAM
#include "prototypes.h"
#include "shadowlog.h"
#include "sizeof.h"
-#include "string/zustr2stp.h"
+#include "string/strcpy/zustr2stp.h"
+
+
/*
* Global variables
*/
#include "pwio.h"
#include "shadowio.h"
#include "shadowlog.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
#include "time/day_to_str.h"
#include "exitcodes.h"
#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
/*
$(NULL)
test_strtcpy_SOURCES = \
- ../../lib/string/strtcpy.c \
+ ../../lib/string/strcpy/strtcpy.c \
test_strtcpy.c \
$(NULL)
test_strtcpy_CFLAGS = \
#include <cmocka.h>
#include "sizeof.h"
-#include "string/strncpy.h"
+#include "string/strcpy/strncpy.h"
static void test_STRNCPY_trunc(void **state);
#include <cmocka.h>
#include "sizeof.h"
-#include "string/strtcpy.h"
+#include "string/strcpy/strtcpy.h"
static void test_STRTCPY_trunc(void **state);
#include <stdint.h> // Required by <cmocka.h>
#include <cmocka.h>
-#include "string/zustr2stp.h"
+#include "string/strcpy/zustr2stp.h"
static void test_ZUSTR2STP(void **state);