]> git.baikalelectronics.ru Git - kernel.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>
Thu, 24 Oct 2013 15:17:08 +0000 (17:17 +0200)
commitcaf36c5161cfcbc375ec7f2fed052f05a4182463
tree6273d59bf1f6f7f9186a276731ee277627f13180
parent21ca859d0f3dc691c643f5ab0a331911cbfe3b81
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