mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 06:41:33 +00:00
Work around a C++ standard defect
Reported on Solaris 5.9: nmap_dns.cc:1320: error: no match for 'operator!=' in 'c != std::basic_string<_CharT, _Traits, _Alloc>::rend() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]()' Reference: https://stackoverflow.com/questions/2135094/gcc-reverse-iterator-comparison-operators-missing
This commit is contained in:
@@ -1317,7 +1317,8 @@ bool DNS::Factory::ipToPtr(const sockaddr_storage &ip, std::string &ptr)
|
|||||||
|
|
||||||
std::string ipv4 = ipv4_c;
|
std::string ipv4 = ipv4_c;
|
||||||
std::string octet;
|
std::string octet;
|
||||||
for (std::string::const_reverse_iterator c=ipv4.rbegin(); c != ipv4.rend(); ++c)
|
std::string::const_reverse_iterator crend = ipv4.rend();
|
||||||
|
for (std::string::const_reverse_iterator c=ipv4.rbegin(); c != crend; ++c)
|
||||||
if((*c)=='.')
|
if((*c)=='.')
|
||||||
{
|
{
|
||||||
ptr += octet + ".";
|
ptr += octet + ".";
|
||||||
@@ -1382,7 +1383,8 @@ bool DNS::Factory::ptrToIp(const std::string &ptr, sockaddr_storage &ip)
|
|||||||
{
|
{
|
||||||
|
|
||||||
std::string octet;
|
std::string octet;
|
||||||
for (std::string::const_reverse_iterator it = mptr.rend()-pos; it != mptr.rend(); ++it)
|
std::string::const_reverse_iterator crend = mptr.rend();
|
||||||
|
for (std::string::const_reverse_iterator it = crend-pos; it != crend; ++it)
|
||||||
{
|
{
|
||||||
const char &c = *it;
|
const char &c = *it;
|
||||||
if(c == '.')
|
if(c == '.')
|
||||||
|
|||||||
Reference in New Issue
Block a user