[PATCH] Take undef enum into account for correct array index comparison

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Previously this would compare to the wrong index
since the enum has an additional UNDEF entry

Signed-off-by: Alex Kalenyuk <akalenyu@xxxxxxxxxx>
---
 libmultipath/dict.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index a06a6138..2e820b2e 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -550,6 +550,7 @@ static int snprint_def_partition_delim(struct config *conf, struct strbuf *buff,
 }
 
 static const char * const find_multipaths_optvals[] = {
+	[FIND_MULTIPATHS_UNDEF] = "undef",
 	[FIND_MULTIPATHS_OFF] = "off",
 	[FIND_MULTIPATHS_ON] = "on",
 	[FIND_MULTIPATHS_STRICT] = "strict",
@@ -793,6 +794,7 @@ declare_def_snprint(allow_usb_devices, print_yes_no)
 
 
 static const char * const flush_on_last_del_optvals[] = {
+	[FLUSH_UNDEF] = "undef",
 	[FLUSH_NEVER] = "never",
 	[FLUSH_ALWAYS] = "always",
 	[FLUSH_UNUSED] = "unused",
-- 
2.50.1





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux