mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Correct size parameter to strncmp
The wrong value passed to strncmp meant that only enable and disable were being accepted. This change corrects the logic so enabled and disabled are also accepted. Pull Request: https://github.com/freebsd/freebsd-src/pull/739 MFC after: 1 week Reviewed by: delphij, ngie
This commit is contained in:
parent
cef2565587
commit
5a9c724847
|
@ -246,9 +246,9 @@ volume_cache(int ac, char **av)
|
|||
Settings = volume->VolumeSettings.Settings;
|
||||
|
||||
NewSettings = Settings;
|
||||
if (strncmp(av[2], "enable", sizeof("enable")) == 0)
|
||||
if (strncmp(av[2], "enable", strlen("enable")) == 0)
|
||||
NewSettings |= 0x01;
|
||||
if (strncmp(av[2], "disable", sizeof("disable")) == 0)
|
||||
else if (strncmp(av[2], "disable", strlen("disable")) == 0)
|
||||
NewSettings &= ~0x01;
|
||||
|
||||
if (NewSettings == Settings) {
|
||||
|
|
Loading…
Reference in a new issue