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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user