Skip to content

Commit

Permalink
[BOX32] Fixed gethostbyname 32bits wrapped function (for #1780 but st…
Browse files Browse the repository at this point in the history
…ill crashing)
  • Loading branch information
ptitSeb committed Sep 13, 2024
1 parent b504d07 commit af476e0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/libtools/libc_net32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af476e0

Please sign in to comment.