From 231b78a0d739c9d545ec34dd9951b9e968355142 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 May 2015 01:30:46 +0200 Subject: [PATCH] Avoid using possibly invalid field in generic wxTimePickerCtrl. The value actually can't be invalid in this code as we ensure that it's never set to Field_Max elsewhere but as we still have this value in the switch (in order to avoid compile-time warnings about not handling some enum elements), ensure that we don't use this invalid value if we end up here to avoid Coverity warnings about what happens downstream in the code if we did. --- src/generic/timectrlg.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generic/timectrlg.cpp b/src/generic/timectrlg.cpp index a6fa14549c..e474338db6 100644 --- a/src/generic/timectrlg.cpp +++ b/src/generic/timectrlg.cpp @@ -414,6 +414,7 @@ private: case Field_Max: wxFAIL_MSG( "Invalid field" ); + return; } UpdateText();