mirror of https://gitee.com/openkylin/qemu.git
rdmacm-mux: fix strcpy string warning
../contrib/rdmacm-mux/main.c: In function ‘parse_args’: ../contrib/rdmacm-mux/main.c:118:13: error: ‘strncpy’ specified bound 3835 equals destination size [-Werror=stringop-truncation] 118 | strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX); Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190712165154.11504-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c2e8a52ca2
commit
60ae0b91fe
|
@ -115,7 +115,7 @@ static void parse_args(int argc, char *argv[])
|
|||
|
||||
case 's':
|
||||
/* This is temporary, final name will build below */
|
||||
strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);
|
||||
strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX - 1);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
|
|
Loading…
Reference in New Issue