mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-15 00:34:05 +09:00
replace sprintf by snprintf (silence warning by macOS compiler)
This commit is contained in:
@@ -296,7 +296,7 @@ static std::string find_mac () {
|
||||
}
|
||||
mac.erase();
|
||||
for (int i = 0; i < 6; i++) {
|
||||
sprintf(str,"%02x", int(address->PhysicalAddress[i]));
|
||||
snprintf(str, sizeof(str), "%02x", int(address->PhysicalAddress[i]));
|
||||
mac = mac + str;
|
||||
if (i < 5) mac = mac + ":";
|
||||
}
|
||||
@@ -329,7 +329,7 @@ static std::string find_mac () {
|
||||
if (non_null_octets) {
|
||||
mac.erase();
|
||||
for (int i = 0; i < 6 ; i++) {
|
||||
sprintf(str,"%02x", octet[i]);
|
||||
snprintf(str, sizeof(str), "%02x", octet[i]);
|
||||
mac = mac + str;
|
||||
if (i < 5) mac = mac + ":";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user