]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Remove unnecessary NUL terminators
authorAlejandro Colomar <alx@kernel.org>
Sun, 29 Jan 2023 23:56:57 +0000 (00:56 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 16 Feb 2023 10:29:33 +0000 (11:29 +0100)
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 <alx@kernel.org>
src/groupmod.c

index 3799235cda632e36d84f8ba9ef10cc22c1604b27..ee6c3e6c1c242a3c405c9faa79558a92cab63c0b 100644 (file)
@@ -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);