Parse address port as unsigned short
This commit is contained in:
parent
f5d10e6e79
commit
2dd4f978af
2 changed files with 3 additions and 2 deletions
|
@ -413,7 +413,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
int Size = Reader.ReadByte();
|
int Size = Reader.ReadByte();
|
||||||
int Family = Reader.ReadByte();
|
int Family = Reader.ReadByte();
|
||||||
int Port = EndianSwap.Swap16(Reader.ReadInt16());
|
int Port = EndianSwap.Swap16(Reader.ReadUInt16());
|
||||||
|
|
||||||
string IpAddress = Reader.ReadByte().ToString() + "." +
|
string IpAddress = Reader.ReadByte().ToString() + "." +
|
||||||
Reader.ReadByte().ToString() + "." +
|
Reader.ReadByte().ToString() + "." +
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
static class EndianSwap
|
static class EndianSwap
|
||||||
{
|
{
|
||||||
public static short Swap16(short Value) => (short) (((Value >> 8) & 0xff) | (Value << 8));
|
public static short Swap16(short Value) => (short) (((Value >> 8) & 0xff) | (Value << 8));
|
||||||
|
public static ushort Swap16(ushort Value) => (ushort)(((Value >> 8) & 0xff) | (Value << 8));
|
||||||
|
|
||||||
public static int Swap32(int Value)
|
public static int Swap32(int Value)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue