]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/date_to_str.c, configure.ac: Replace calls to strlcpy(3) by strtcpy(3)
authorAlejandro Colomar <alx@kernel.org>
Sun, 12 Nov 2023 13:10:57 +0000 (14:10 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Wed, 22 Nov 2023 11:55:26 +0000 (12:55 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/date_to_str.c

index 6bea1167c5a583e03e60909f589afd6a99119b88..2c8cca3fca55463aa3f9d5161c287bff4868c33f 100644 (file)
@@ -434,7 +434,6 @@ if test "$with_libbsd" != "no"; then
        AC_DEFINE(WITH_LIBBSD, 1, [Build shadow with libbsd support])
 else
        AC_DEFINE(WITH_LIBBSD, 0, [Build shadow without libbsd support])
-       AC_CHECK_FUNC(strlcpy, [], [AC_MSG_ERROR([strlcpy is required from glibc >= 2.38 or libbsd])])
 fi
 AM_CONDITIONAL(WITH_LIBBSD, test x$with_libbsd = xyes)
 
index 9d004d9ee7404df33c6216cafe1d3b638979dbb7..cb3f6d5af5988a3124748cb931ec4bb52b06dcd8 100644 (file)
@@ -33,6 +33,7 @@
 
 #ident "$Id$"
 
+#include "strtcpy.h"
 #include "prototypes.h"
 
 void
@@ -43,13 +44,13 @@ date_to_str(size_t size, char buf[size], long date)
 
        t = date;
        if (date < 0) {
-               (void) strlcpy(buf, "never", size);
+               (void) strtcpy(buf, "never", size);
                return;
        }
 
        tm = gmtime(&t);
        if (tm == NULL) {
-               (void) strlcpy(buf, "future", size);
+               (void) strtcpy(buf, "future", size);
                return;
        }