File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535# define DYNLIB_COMPILE_TIME_EXPR constexpr
3636#endif
3737
38+ #define INVALID_DYNLIB_BYTE (~0 )
39+
3840namespace DynLibUtils {
3941
4042struct Section_t
@@ -187,7 +189,7 @@ inline auto ParsePattern(const std::string_view svInput)
187189 if (' a' <= c && c <= ' f' ) return 10 + (c - ' a' );
188190 if (' A' <= c && c <= ' F' ) return 10 + (c - ' A' );
189191
190- return 0 ;
192+ return INVALID_DYNLIB_BYTE ;
191193 };
192194
193195 size_t n = 0 ;
@@ -210,7 +212,7 @@ inline auto ParsePattern(const std::string_view svInput)
210212 {
211213 auto nLeft = funcGetHexByte (svInput[n]), nRight = funcGetHexByte (svInput[n + 1 ]);
212214
213- bool bIsValid = nLeft && nRight;
215+ bool bIsValid = nLeft != INVALID_DYNLIB_BYTE && nRight != INVALID_DYNLIB_BYTE ;
214216
215217 assert (bIsValid && R"( Passing invalid characters. Allowed: <space> or pair: "0-9", "a-f", "A-F" or "?")" );
216218 if (!bIsValid)
You can’t perform that action at this time.
0 commit comments