Fix compiler warning: output may be truncated
winscard_msg.c: In function ‘ClientSetupSession’: winscard_msg.c:134:2: warning: ‘strncpy’ output may be truncated copying 108 bytes from a string of length 109 [-Wstringop-truncation] strncpy(svc_addr.sun_path, socketName, sizeof(svc_addr.sun_path)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The source was sizeof(struct sockaddr_un) bytes long. But the destination was sizeof(svc_addr.sun_path) bytes long only. svc_addr is a struct sockaddr_un but the sun_path field is shorter (1 byte shorter according to the compiler) than the complete struct sockaddr_un.
Showing with 3 additions and 1 deletion