]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/monwriter: fix smatch warning for strcpy()
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Mon, 14 Oct 2013 13:51:31 +0000 (15:51 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 22 Oct 2013 07:18:25 +0000 (09:18 +0200)
commitce81a5abff7d79e801e0aa26558ad594301b9a49
treea80c268c38db56af3e58b41b34d5d0be5b40b19e
parent9b3b5f54e249cba26aff7f86214ce5256178232f
s390/monwriter: fix smatch warning for strcpy()

This patch fixes the following smatch warning:
monwrite_diag() error: strcpy() '"LNXAPPL"' too large for 'id.prod_nr'
(8 vs 7)
Using strcpy() is wrong, because it also copies the terminating null
byte, but in this case the extra copied null byte will be overwritten
right after the strcpy(), so there is no real problem here.
Use strncpy() to fix the warning.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/monwriter.c