diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-09-13 10:47:47 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-09-13 10:47:47 +0200 |
| commit | af476e0d10fa082df386aa45aa6f54f3f1c9fb45 (patch) | |
| tree | b1cde986cb8c0fbc0f91666c465bf3096baaba3e /src | |
| parent | b504d07afe4f7d06b50e8347074be9a1d0451a9d (diff) | |
| download | box64-af476e0d10fa082df386aa45aa6f54f3f1c9fb45.tar.gz box64-af476e0d10fa082df386aa45aa6f54f3f1c9fb45.zip | |
[BOX32] Fixed gethostbyname 32bits wrapped function (for #1780 but still crashing)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libtools/libc_net32.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libtools/libc_net32.c b/src/libtools/libc_net32.c index bfcc606b..14101aea 100644 --- a/src/libtools/libc_net32.c +++ b/src/libtools/libc_net32.c @@ -114,17 +114,20 @@ EXPORT void* my32_gethostbyname(x64emu_t* emu, const char* a) int idx = 0; ret.h_aliases = h->h_aliases?s:0; if(h->h_aliases) { - char* p = *h->h_aliases; - while(p) { - strings[idx++] = to_cstring(p++); + char** p = h->h_aliases; + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; } strings[idx++] = 0; } ret.h_addr_list = h->h_addr_list?to_ptrv(&strings[idx]):0; if(h->h_addr_list) { - void* p = *h->h_addr_list; - while(p) - strings[idx++] = to_ptrv(p++); + char** p = h->h_addr_list; + while(*p) { + strings[idx++] = to_ptrv(*p); + ++p; + } strings[idx++] = 0; } // done |