mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2026-01-08 21:14:16 +00:00
src: avoid warning about strncpy without trailing NUL
We know that the destination will already have a trailing NUL after the three characters we're copying. The compiler can't see this though and warns about lack of NUL termination. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
f6007cfad1
commit
0fdd3ed563
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
// We expect our helper to end with .com
|
||||
assert(strncmp(name + len - 3, "com", 4) == 0);
|
||||
// replace .com with .exe
|
||||
strncpy(name + len - 3, "exe", 3);
|
||||
memcpy(name + len - 3, "exe", 3);
|
||||
}
|
||||
|
||||
si.cb = sizeof(si);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user