File tree 1 file changed +4
-6
lines changed 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,8 @@ MacAddress6::MacAddress6(const uint8_t *macbytearray) {
14
14
memcpy (_mac.bytes , macbytearray, sizeof (_mac.bytes ));
15
15
}
16
16
17
-
18
-
19
17
// Parse user entered string into MAC address
20
- bool MacAddress6::fromCStr (const char *buf) { // TODO test this!
18
+ bool MacAddress6::fromCStr (const char *buf) {
21
19
char cs[18 ];
22
20
char *token;
23
21
char *next; // Unused but required
@@ -26,11 +24,11 @@ bool MacAddress6::fromCStr(const char *buf) { //TODO test this!
26
24
strncpy (cs, buf, sizeof (cs)); // strtok modifies the buffer: copy to working buffer.
27
25
28
26
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
30
28
if (!token) { // No more tokens found
31
29
return false ;
32
30
}
33
- _mac.bytes [i] = strtol ( token, &next, 16 );
31
+ _mac.bytes [i] = strtol (token, &next, 16 );
34
32
}
35
33
return true ;
36
34
}
@@ -75,4 +73,4 @@ MacAddress6& MacAddress6::operator=(uint64_t macval)
75
73
{
76
74
_mac.val = macval;
77
75
return *this ;
78
- }
76
+ }
You can’t perform that action at this time.
0 commit comments