From 1bfb0fc0086a4db907e1049feb856e23ed54a074 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Date: Sat, 8 Jun 2024 21:29:30 +0200
Subject: [PATCH 20/23] simpleinit: Fix buffer to accommodate actual message
 sizes

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 login-utils/simpleinit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/login-utils/simpleinit.c b/login-utils/simpleinit.c
index 5b858afac41c..de8e60cb97b1 100644
--- a/login-utils/simpleinit.c
+++ b/login-utils/simpleinit.c
@@ -1552,7 +1552,7 @@ static void process_command (unsigned command,const struct command_struct *comda
 	{			/* launch stop script */
 	    pid_t pid;
 	    struct script_struct *victim = available_list.first;
-	    char txt[256];
+	    char txt[335];
 
 	    sigprocmask(SIG_BLOCK,&all_signals,&oldsigmask);
 	    if ( ( pid = fork () ) == 0 )   /*  Child   */
@@ -1584,7 +1584,7 @@ static void process_command (unsigned command,const struct command_struct *comda
                   }
 			
 		  exec_with_params(fpath, stop, NULL);
-		  snprintf(txt,256,"errno %u running program %s\n",
+		  snprintf(txt,sizeof(txt),"errno %u running program %s\n",
 			errno,fpath);
 		  err ( txt );
 		  _exit (SIG_NOT_STOPPED);
-- 
2.44.0

