1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-24 19:21:35 +01:00

Fixed some issues with Endian::change_endian triggered in OSX.

This commit is contained in:
Matias Fontanini
2012-11-29 21:30:13 -03:00
parent e2426b493e
commit 9bdee61e5b
6 changed files with 1625 additions and 1086 deletions

View File

@@ -83,29 +83,6 @@ struct IPv4Collector {
namespace Tins {
bool Utils::Internals::from_hex(const string &str, uint32_t &result) {
unsigned i(0);
result = 0;
while(i < str.size()) {
uint8_t tmp;
if(str[i] >= 'A' && str[i] <= 'F')
tmp = (str[i] - 'A' + 10);
else if(str[i] >= '0' && str[i] <= '9')
tmp = (str[i] - '0');
else
return false;
result = (result << 4) | tmp;
i++;
}
return true;
}
void Utils::Internals::skip_line(istream &input) {
int c = 0;
while(c != '\n' && input)
c = input.get();
}
/** \endcond */
IPv4Address Utils::resolve_ip(const string &to_resolve) {