diff options
author | Jack Lloyd <[email protected]> | 2019-10-18 11:12:51 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-10-18 11:12:51 -0400 |
commit | bbef28707d07cf0729911144be7d18a3061b2fef (patch) | |
tree | 27920a35d76c27ef66eebd1a580f00e3a321c570 /src/lib | |
parent | 000bdc8725ce1bcde7455cdf532d52145abf4f70 (diff) |
Avoid Coverity warning about unreachable code
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/utils/socket/uri.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/utils/socket/uri.cpp b/src/lib/utils/socket/uri.cpp index ea7188b31..f8506d0e7 100644 --- a/src/lib/utils/socket/uri.cpp +++ b/src/lib/utils/socket/uri.cpp @@ -26,13 +26,15 @@ constexpr bool isdigit(char ch) bool isDomain(const std::string& domain) { -#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20160726) //GCC 4.8 does not support regex +#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20160726) + // GCC 4.8 does not support regex return true; -#endif +#else std::regex re( R"(^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$)"); std::cmatch m; return std::regex_match(domain.c_str(), m, re); +#endif } bool isIPv4(const std::string& ip) |