mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-25 15:32:07 +00:00
libselinux: avcstat: fix build warning
Fix the following build warning. avcstat.c: In function ‘main’: avcstat.c:113:4: error: ‘strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation] strncpy(avcstatfile, optarg, sizeof avcstatfile); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
parent
8467979d41
commit
e76569f863
@ -110,7 +110,8 @@ int main(int argc, char **argv)
|
||||
cumulative = 1;
|
||||
break;
|
||||
case 'f':
|
||||
strncpy(avcstatfile, optarg, sizeof avcstatfile);
|
||||
strncpy(avcstatfile, optarg, sizeof(avcstatfile) - 1);
|
||||
avcstatfile[sizeof(avcstatfile)-1] = '\0';
|
||||
break;
|
||||
case 'h':
|
||||
case '-':
|
||||
|
Loading…
Reference in New Issue
Block a user