Changeset 79747 in vbox for trunk/src/VBox/Runtime/common/net
- Timestamp:
- Jul 12, 2019 11:00:54 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132112
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/net/macstr.cpp
r76553 r79747 51 51 { 52 52 /* 53 * First check if it might be a 12 xdigit string without any separators. 54 */ 55 size_t cchValue = strlen(pszValue); 56 if (cchValue >= 12 && memchr(pszValue, ':', 12) == NULL) 57 { 58 bool fOkay = true; 59 for (size_t off = 0; off < 12 && fOkay; off++) 60 fOkay = RT_C_IS_XDIGIT(pszValue[off]); 61 if (fOkay && cchValue > 12) 62 for (size_t off = 12; off < cchValue && fOkay; off++) 63 fOkay = RT_C_IS_SPACE(pszValue[off]); 64 if (fOkay) 65 { 66 int rc = RTStrConvertHexBytes(pszValue, pAddr, sizeof(*pAddr), 0); 67 if (RT_SUCCESS(rc)) 68 rc = VINF_SUCCESS; 69 return rc; 70 } 71 } 72 73 /* 53 74 * Not quite sure if I should accept stuff like "08::27:::1" here... 54 75 * The code is accepting "::" patterns now, except for for the first
Note:
See TracChangeset
for help on using the changeset viewer.