diff --git a/lib/Makefile.am b/lib/Makefile.am index 96dfefe2..bfe13c33 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -141,6 +141,7 @@ libshadow_la_SOURCES = \ stpecpy.h \ stpeprintf.c \ stpeprintf.h \ + strncpy.h \ strtcpy.c \ strtcpy.h \ strtoday.c \ diff --git a/lib/strncpy.h b/lib/strncpy.h new file mode 100644 index 00000000..fc6fcc96 --- /dev/null +++ b/lib/strncpy.h @@ -0,0 +1,21 @@ +/* + * SPDX-FileCopyrightText: 2023, Alejandro Colomar + * SPDX-License-Identifier: BSD-3-Clause + */ + + +#ifndef SHADOW_INCLUDE_LIB_STRNCPY_H_ +#define SHADOW_INCLUDE_LIB_STRNCPY_H_ + + +#include + +#include + +#include "sizeof.h" + + +#define STRNCPY(dst, src) strncpy(dst, src, NITEMS(dst)) + + +#endif // include guard