about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-09-13 10:47:47 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-09-13 10:47:47 +0200
commitaf476e0d10fa082df386aa45aa6f54f3f1c9fb45 (patch)
treeb1cde986cb8c0fbc0f91666c465bf3096baaba3e
parentb504d07afe4f7d06b50e8347074be9a1d0451a9d (diff)
downloadbox64-af476e0d10fa082df386aa45aa6f54f3f1c9fb45.tar.gz
box64-af476e0d10fa082df386aa45aa6f54f3f1c9fb45.zip
[BOX32] Fixed gethostbyname 32bits wrapped function (for #1780 but still crashing)
-rw-r--r--src/libtools/libc_net32.c15
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