Fix matrix bug in gethostbyname (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Sun, 30 Jul 2017 19:45:09 +0000 (12:45 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sun, 30 Jul 2017 19:45:09 +0000 (12:45 -0700)
I messed that up when making gethostbyname recursive.

Rebuild glibc.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm2_r.c

index 1eea312..c3f35d7 100644 (file)
@@ -43,11 +43,12 @@ int __gethostbyname2_r(const char *name, int af, struct hostent *ret,
                static char *aptr[Nname + 1];
                static char addr[Nname][4];
         * we need to use space in buf for them */
-       char **nptr, **aptr, **addr;
+       char **nptr, **aptr;
+       char (*addr)[4];
        size_t nptr_sz, aptr_sz, addr_sz;
        nptr_sz = sizeof(char *) * (Nname + 1);
        aptr_sz = sizeof(char *) * (Nname + 1);
-       addr_sz = sizeof(char) * Nname * 4;
+       addr_sz = sizeof(char[Nname][4]);
 
        if (nptr_sz + aptr_sz + addr_sz >= buflen) {
                *result = 0;