From: DeaDDooMER Date: Sun, 2 Jan 2022 18:15:06 +0000 (+0300) Subject: svrlist: fix local server ip decoding on big endian machines X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=4c8663e5276acff2eb18ad93b77f341d330c8702;p=d2df-sdl.git svrlist: fix local server ip decoding on big endian machines --- diff --git a/src/engine/e_log.pas b/src/engine/e_log.pas index 7159c18..dbe7b5d 100644 --- a/src/engine/e_log.pas +++ b/src/engine/e_log.pas @@ -60,7 +60,11 @@ var function DecodeIPV4 (ip: LongWord): string; begin +{$IFDEF FPC_LITTLE_ENDIAN} Result := Format('%d.%d.%d.%d', [ip and $FF, (ip shr 8) and $FF, (ip shr 16) and $FF, (ip shr 24)]); +{$ELSE} + Result := Format('%d.%d.%d.%d', [(ip shr 24), (ip shr 16) and $FF, (ip shr 8) and $FF, ip and $FF]); +{$ENDIF} end;