summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-12 14:10:57 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-16 11:44:30 +0100
commit2ad4d7c34c4e12fdcf476e8e44bce7e39314e047 (patch)
tree79be22977bb17d14dba31df3855f62f6f14148a2
parentef492ddf1ca68c283daeab0b07cdb0d2765976db (diff)
lib/date_to_str.c, configure.ac: Replace calls to strlcpy(3) by strtcpy(3)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--configure.ac1
-rw-r--r--lib/date_to_str.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 6bea1167..2c8cca3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
diff --git a/lib/date_to_str.c b/lib/date_to_str.c
index 9d004d9e..cb3f6d5a 100644
--- a/lib/date_to_str.c
+++ b/lib/date_to_str.c
@@ -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;
}