--- amap-5.1.orig/amap-lib.c 2005-09-27 22:06:58.000000000 -0300 +++ amap-5.1/amap-lib.c 2005-09-27 22:20:25.000000000 -0300 @@ -164,10 +164,17 @@ // if ((xx=inet_aton(host, &in)) <= 0) { //printf("failed %d: %d %s\n",xx,AF_INET,host); //#endif - if ((target = gethostbyname(host)) != NULL) { +#ifdef AF_INET6 + if (inet_pton(AF_INET, host, &in) < 0) { +#else + if (inet_aton(host, &in) <= 0) { +#endif + if ((target = gethostbyname(host)) != NULL) memcpy((char*)&ip, (char*)target->h_addr, 4); - } else + else amap_error("could not resolve host: %s", host); + } else + memcpy((char*)&ip, (char*)&in.s_addr, 4); // } else //{ // memcpy((char*)&ip, (char*)&in.s_addr, 4);