mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 04:39:34 +00:00
Merge pull request #16651 from amverweij/issue16646
Libretro: skip leading zeros in IP address.
This commit is contained in:
commit
24098bc233
@ -1096,13 +1096,21 @@ static void check_variables(CoreParameter &coreParam)
|
|||||||
if (changeProAdhocServer == "IP address")
|
if (changeProAdhocServer == "IP address")
|
||||||
{
|
{
|
||||||
g_Config.proAdhocServer = "";
|
g_Config.proAdhocServer = "";
|
||||||
|
bool leadingZero = true;
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
{
|
{
|
||||||
if (i && i % 3 == 0)
|
if (i && i % 3 == 0)
|
||||||
|
{
|
||||||
g_Config.proAdhocServer += '.';
|
g_Config.proAdhocServer += '.';
|
||||||
|
leadingZero = true;
|
||||||
|
}
|
||||||
|
|
||||||
int addressPt = ppsspp_pro_ad_hoc_ipv4[i];
|
int addressPt = ppsspp_pro_ad_hoc_ipv4[i];
|
||||||
g_Config.proAdhocServer += static_cast<char>('0' + addressPt);
|
if (addressPt || i % 3 == 2)
|
||||||
|
leadingZero = false; // We are either non-zero or the last digit of a byte
|
||||||
|
|
||||||
|
if (! leadingZero)
|
||||||
|
g_Config.proAdhocServer += static_cast<char>('0' + addressPt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user