Disable stringop-truncation false positive warnings on gcc 8.
Strings in struct utmp/utmpx are not guaranteed to be NUL-terminated.
This commit is contained in:
@@ -52,6 +52,14 @@
|
||||
#include "sudo.h"
|
||||
#include "sudo_exec.h"
|
||||
|
||||
/*
|
||||
* GCC 8 warns about strncpy() where the size field is the size of the buffer.
|
||||
* However, strings in utmp may not be NUL terminated so this usage is correct.
|
||||
*/
|
||||
#if __GNUC_PREREQ__(8, 0)
|
||||
# pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplify handling of different utmp types.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user