1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

Fix a bug in --script-trace hex dump output resulting in bytes with highest bit set to be prefixed by ffffff.

This commit is contained in:
sven
2008-09-03 22:09:15 +00:00
parent f3e1777d95
commit 801e537697
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
# Nmap Changelog ($Id$); -*-text-*-
o Fix a bug in --script-trace hex dump output resulting in bytes with
highest bit set to be prefixed by ffffff. [Sven Klemm]
o Updated rpcinfo NSE script to use the new pack/unpack (binlib)
functions, use the new tab library, include better documentation, and
fix some bugs. [Sven Klemm]

View File

@@ -87,7 +87,7 @@ static std::string hexify (const char *str, size_t len)
if (isprint(str[i]) || isspace(str[i]))
ret << str[i];
else
ret << std::setw(3) << "\\" << (unsigned int) str[i];
ret << std::setw(3) << "\\" << (unsigned int)(unsigned char) str[i];
}
return ret.str();
}
@@ -98,7 +98,7 @@ static std::string hexify (const char *str, size_t len)
ret << std::setw(8) << i << ": ";
for (size_t j = i; j < i + 16; j++)
if (j < len)
ret << std::setw(2) << (unsigned int) str[j] << " ";
ret << std::setw(2) << (unsigned int)(unsigned char) str[j] << " ";
else
ret << " ";
for (size_t j = i; j < i + 16 && j < len; j++)