]> granicus.if.org Git - shadow/commitdiff
Use sizeof rather than hardcoding snprintf's size argument.
authorAdam Sampson <ats@offog.org>
Thu, 15 Sep 2016 15:54:42 +0000 (16:54 +0100)
committerAdam Sampson <ats@offog.org>
Tue, 20 Sep 2016 07:04:14 +0000 (08:04 +0100)
src/su.c

index 93ffd2fbe2b4e3bffcdc6c42a280bd956b2b39f4..d605af8e7f86abecd2902b06d97084fc71e7b48f 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -373,8 +373,8 @@ static void prepare_pam_close_session (void)
                              stderr);
                (void) kill (-pid_child, caught);
 
-               snprintf (kill_msg, 256, _(" ...killed.\n"));
-               snprintf (wait_msg, 256, _(" ...waiting for child to terminate.\n"));
+               snprintf (kill_msg, sizeof kill_msg, _(" ...killed.\n"));
+               snprintf (wait_msg, sizeof wait_msg, _(" ...waiting for child to terminate.\n"));
 
                (void) signal (SIGALRM, kill_child);
                (void) alarm (2);