Skip to content

Commit

Permalink
Portduino: fix setting hwId via argument (#5565)
Browse files Browse the repository at this point in the history
  • Loading branch information
GUVWAF authored Dec 14, 2024
1 parent c3f89a6 commit 44cf6d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/portduino/PortduinoGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ void getMacAddr(uint8_t *dmac)
if (strlen(optionMac) >= 12) {
MAC_from_string(optionMac, dmac);
} else {
uint32_t hwId = sscanf(optionMac, "%u", &hwId);
uint32_t hwId;
sscanf(optionMac, "%u", &hwId);
dmac[0] = 0x80;
dmac[1] = 0;
dmac[2] = hwId >> 24;
Expand Down Expand Up @@ -532,4 +533,4 @@ bool MAC_from_string(std::string mac_str, uint8_t *dmac)
} else {
return false;
}
}
}

0 comments on commit 44cf6d3

Please sign in to comment.