From 370652ba058c6a1099d40fa813e0d8a71ba4cb4c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 29 Jul 2023 18:13:06 +0200 Subject: [PATCH] defines.h: Remove definition of STRFCPY() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not being used anymore. We got rid of it in favor of better APIs. Well, it's still being used in one place: a contrib/ patch, but I explicitly want to break it, so that someone reviews it. I don't want to modify it, since it's not being tested, so it would be very risky for me to touch it. Instead, let it bitrot, and if someone cares, they'll update it correctly. BTW, the comment that said /* danger -side effects */ was wrong: sizeof() doesn't evaluate the argument (unless it's a VLA), so there wasn't really a double-evaluation issue. Cc: Christian Göttsche Cc: Serge Hallyn Cc: Iker Pedrosa Signed-off-by: Alejandro Colomar --- lib/defines.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/defines.h b/lib/defines.h index d517424c..3a280b3e 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -155,14 +155,6 @@ #define SCALE DAY #endif -/* Copy string pointed by B to array A with size checking. It was originally - in lmain.c but is _very_ useful elsewhere. Some setuid root programs with - very sloppy coding used to assume that BUFSIZ will always be enough... */ - - /* danger - side effects */ -#define STRFCPY(A,B) \ - (strncpy((A), (B), sizeof(A) - 1), (A)[sizeof(A) - 1] = '\0') - #ifndef PASSWD_FILE #define PASSWD_FILE "/etc/passwd" #endif