From: Alejandro Colomar Date: Sun, 29 Jan 2023 23:56:57 +0000 (+0100) Subject: Remove unnecessary NUL terminators X-Git-Tag: 4.14.0-rc1~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a9285aacbf2944e113914e6432c6f8d3efe2692;p=thirdparty%2Fshadow.git Remove unnecessary NUL terminators All the string-copying functions called above do terminate the strings they create with a NUL byte. Writing it again at the end of the buffer is unnecessary paranoid code. Let's remove it. Signed-off-by: Alejandro Colomar --- diff --git a/src/groupmod.c b/src/groupmod.c index 3799235cd..ee6c3e6c1 100644 --- a/src/groupmod.c +++ b/src/groupmod.c @@ -627,11 +627,6 @@ static void prepare_failure_reports (void) stpeprintf(info_passwd.action+strlen (info_passwd.action), pw_end, "%ju", (uintmax_t) group_newid); } - info_group.audit_msg[511] = '\0'; -#ifdef SHADOWGRP - info_gshadow.audit_msg[511] = '\0'; -#endif - info_passwd.audit_msg[511] = '\0'; // FIXME: add a system cleanup add_cleanup (cleanup_report_mod_group, &info_group);