X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Farpa_inet.psi;h=6fdf0fb83229be71e76833ff6e4f5aba6c7c5121;hp=f9aae9e47eb151318383d151818526379b1035f1;hb=c9384515a81cb64d345b299908b2852f51bb8e6e;hpb=b029005e56a8913fbb3d17ab497b4a37a00a211c diff --git a/psi.d/arpa_inet.psi b/psi.d/arpa_inet.psi index f9aae9e..6fdf0fb 100644 --- a/psi.d/arpa_inet.psi +++ b/psi.d/arpa_inet.psi @@ -34,7 +34,7 @@ function psi\inet_ntoa(array $in) : string { function psi\inet_ntop(int $af, string $src) : string { let af = intval($af); let src = strval($src); - let size = psi\SIZEOF_STRUCT_SOCKADDR_STORAGE; + let size = sizeof(struct sockaddr_storage); let dst = calloc(1, size); return inet_ntop(af, src, dst, size) as to_string(inet_ntop); } @@ -42,7 +42,7 @@ function psi\inet_ntop(int $af, string $src) : string { function psi\inet_pton(int $af, string $src, string &$dst) : int { let af = intval($af); let src = strval($src); - let dst = calloc(1, psi\SIZEOF_STRUCT_SOCKADDR_STORAGE); + let dst = calloc(1, sizeof(struct sockaddr_storage)); return inet_pton(af, src, dst) as to_int(inet_pton); - set $dst = to_string(dst, psi\SIZEOF_STRUCT_SOCKADDR_STORAGE); + set $dst = to_string(dst, sizeof(struct sockaddr_storage)); } \ No newline at end of file