From: Alejandro Colomar Date: Sat, 29 Jul 2023 16:13:06 +0000 (+0200) Subject: defines.h: Remove definition of STRFCPY() X-Git-Tag: 4.15.0-rc1~190 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=370652ba058c6a1099d40fa813e0d8a71ba4cb4c;p=thirdparty%2Fshadow.git defines.h: Remove definition of STRFCPY() 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 --- diff --git a/lib/defines.h b/lib/defines.h index d517424cd..3a280b3ea 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