summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/MAC.hpp2
-rw-r--r--node/MulticastGroup.hpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/node/MAC.hpp b/node/MAC.hpp
index cd749911..e4f69aa6 100644
--- a/node/MAC.hpp
+++ b/node/MAC.hpp
@@ -158,6 +158,8 @@ public:
inline void fromString(const char *s)
{
char tmp[8];
+ for(int i=0;i<6;++i)
+ tmp[i] = (char)0;
Utils::unhex(s,tmp,6);
setTo(tmp,6);
}
diff --git a/node/MulticastGroup.hpp b/node/MulticastGroup.hpp
index 659b05d8..cdb8b6db 100644
--- a/node/MulticastGroup.hpp
+++ b/node/MulticastGroup.hpp
@@ -124,13 +124,11 @@ public:
{
char hex[17];
unsigned int hexlen = 0;
- while ((*s)&&(*s != '/')&&(hexlen < sizeof(hex) - 1))
+ while ((*s)&&(*s != '/')&&(hexlen < (sizeof(hex) - 1)))
hex[hexlen++] = *s;
hex[hexlen] = (char)0;
_mac.fromString(hex);
- if (*s == '/')
- _adi = (uint32_t)Utils::hexStrToULong(++s);
- else _adi = 0;
+ _adi = (*s == '/') ? (uint32_t)Utils::hexStrToULong(s + 1) : (uint32_t)0;
}
/**