[S390] early: limit savesys cmd string handling
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 23 Mar 2011 09:14:59 +0000 (10:14 +0100)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Wed, 23 Mar 2011 09:15:14 +0000 (10:15 +0100)
Use snprintf() here as well so we won't have to deal with this again.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/early.c

index 668138ee85d9eee51f67aa40b6669901e76ef9aa..068f8465c4ee07c0156978517f9efe88dcc5e96a 100644 (file)
@@ -143,8 +143,9 @@ static noinline __init void create_kernel_nss(void)
        snprintf(defsys_cmd + hlen, DEFSYS_CMD_SIZE - hlen,
                 " EW MINSIZE=%.7iK PARMREGS=0-13", min_size);
        defsys_cmd[DEFSYS_CMD_SIZE - 1] = '\0';
-       sprintf(savesys_cmd, "SAVESYS %s \n IPL %s",
-               kernel_nss_name, kernel_nss_name);
+       snprintf(savesys_cmd, SAVESYS_CMD_SIZE, "SAVESYS %s \n IPL %s",
+                kernel_nss_name, kernel_nss_name);
+       savesys_cmd[SAVESYS_CMD_SIZE - 1] = '\0';
 
        __cpcmd(defsys_cmd, NULL, 0, &response);