|
|
| version 1.22, 2026/07/19 14:25:42 | version 1.24, 2026/10/18 21:05:35 |
|---|---|
| Line 10 | Line 10 |
| #include "pa_vtable.h" | #include "pa_vtable.h" |
| #ifdef _MSC_VER | #ifdef _MSC_VER |
| #include "winsock2.h" | #include <ws2tcpip.h> |
| #include "ws2tcpip.h" | |
| #endif | #endif |
| volatile const char * IDENT_INET_C="$Id$"; | volatile const char * IDENT_INET_C="$Id$"; |
| Line 28 DECLARE_CLASS_VAR(inet, new MInet); | Line 27 DECLARE_CLASS_VAR(inet, new MInet); |
| static void _ntoa(Request& r, MethodParams& params){ | static void _ntoa(Request& r, MethodParams& params){ |
| unsigned long l=(unsigned long)trunc(params.as_double(0, "parameter must be expression", r)); | unsigned long l=(unsigned long)trunc(params.as_double(0, "parameter must be expression", r)); |
| static const int ip_cstr_bufsize=3*4+3+1/*zero-teminator*/+1/*for faulty snprintfs*/; | static const int ip_cstr_bufsize=3*4+3+1/*zero-teminator*/; |
| char* ip_cstr=new(PointerFreeGC) char[ip_cstr_bufsize]; | char* ip_cstr=new(PointerFreeGC) char[ip_cstr_bufsize]; |
| snprintf(ip_cstr, ip_cstr_bufsize, "%u.%u.%u.%u", (l>>24) & 0xFF, (l>>16) & 0xFF, (l>>8) & 0xFF, l & 0xFF); | pa_snprintf(ip_cstr, ip_cstr_bufsize, "%u.%u.%u.%u", (l>>24) & 0xFF, (l>>16) & 0xFF, (l>>8) & 0xFF, l & 0xFF); |
| r.write(*new String(ip_cstr)); | r.write(*new String(ip_cstr)); |
| } | } |