Skip to content
Commit 3cf11d77 authored by Gerald Schaefer's avatar Gerald Schaefer Committed by Martin Schwidefsky
Browse files

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: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 57f47ba0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment