Skip to content

Commit 87b1204

Browse files
Update MacAddress6.cpp
1 parent 4384341 commit 87b1204

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cores/esp32/MacAddress6.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ MacAddress6::MacAddress6(const uint8_t *macbytearray) {
1414
memcpy(_mac.bytes, macbytearray, sizeof(_mac.bytes));
1515
}
1616

17-
18-
1917
//Parse user entered string into MAC address
20-
bool MacAddress6::fromCStr(const char *buf) { //TODO test this!
18+
bool MacAddress6::fromCStr(const char *buf) {
2119
char cs[18];
2220
char *token;
2321
char *next; //Unused but required
@@ -26,11 +24,11 @@ bool MacAddress6::fromCStr(const char *buf) { //TODO test this!
2624
strncpy(cs, buf, sizeof(cs)); //strtok modifies the buffer: copy to working buffer.
2725

2826
for(i=0; i<sizeof(_mac.bytes); i++) {
29-
token = strtok( (i==0) ? cs : NULL, ":"); //Find first or next token
27+
token = strtok((i==0) ? cs : NULL, ":"); //Find first or next token
3028
if(!token) { //No more tokens found
3129
return false;
3230
}
33-
_mac.bytes[i] = strtol( token, &next, 16);
31+
_mac.bytes[i] = strtol(token, &next, 16);
3432
}
3533
return true;
3634
}
@@ -75,4 +73,4 @@ MacAddress6& MacAddress6::operator=(uint64_t macval)
7573
{
7674
_mac.val = macval;
7775
return *this;
78-
}
76+
}

0 commit comments

Comments
 (0)