mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-06 14:02:47 -05:00
Suppress strncpy truncation warnings with GCC 8 and later.
These warnings are bogus as the code is correct so we suppress them in the places they occur.
This commit is contained in:

committed by
Simon Tatham

parent
822d2fd4c3
commit
b5c840431a
@ -1678,7 +1678,14 @@ Socket new_unix_listener(SockAddr listenaddr, Plug plug)
|
||||
|
||||
memset(&u, '\0', sizeof(u));
|
||||
u.su.sun_family = AF_UNIX;
|
||||
#if __GNUC__ >= 8
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif // __GNUC__ >= 8
|
||||
strncpy(u.su.sun_path, listenaddr->hostname, sizeof(u.su.sun_path)-1);
|
||||
#if __GNUC__ >= 8
|
||||
# pragma GCC diagnostic pop
|
||||
#endif // __GNUC__ >= 8
|
||||
addr = &u;
|
||||
addrlen = sizeof(u.su);
|
||||
|
||||
|
Reference in New Issue
Block a user