mirror of
https://github.com/Vita3K/Vita3K.git
synced 2026-07-11 01:34:23 +02:00
modules/SceNetCtl: Fix IP/netmask in InetGetInfo by copy string.
- info->(ip_address/netmask) correctly hold the complete IP/netmask strings.
This commit is contained in:
@@ -577,10 +577,12 @@ EXPORT(int, sceNetCtlInetGetInfo, int code, SceNetCtlInfo *info) {
|
||||
// STUBBED("code SCE_NETCTL_INFO_GET_RSSI_PERCENTAGE return 100%");
|
||||
break;
|
||||
case SCE_NETCTL_INFO_GET_IP_ADDRESS:
|
||||
inet_pton(AF_INET, addr.addr.c_str(), &info->ip_address);
|
||||
std::strncpy(info->ip_address, addr.addr.c_str(), sizeof(info->ip_address) - 1);
|
||||
info->ip_address[sizeof(info->ip_address) - 1] = '\0';
|
||||
break;
|
||||
case SCE_NETCTL_INFO_GET_NETMASK:
|
||||
inet_pton(AF_INET, addr.netMask.c_str(), &info->netmask);
|
||||
std::strncpy(info->netmask, addr.netMask.c_str(), sizeof(info->netmask) - 1);
|
||||
info->netmask[sizeof(info->netmask) - 1] = '\0';
|
||||
break;
|
||||
default:
|
||||
switch (code) {
|
||||
|
||||
Reference in New Issue
Block a user