Geoip: Fix compilation #4.

This commit is contained in:
Arkshine 2014-07-30 09:06:33 +02:00
parent 6916eb8613
commit 9d59de41a2

View File

@ -51,7 +51,7 @@
#ifdef MMDB_DEBUG #ifdef MMDB_DEBUG
DEBUG_FUNC char *byte_to_binary(uint8_t byte) DEBUG_FUNC char *byte_to_binary(uint8_t byte)
{ {
char *bits = malloc(sizeof(char) * 9); char *bits = (char *)malloc(sizeof(char) * 9);
if (NULL == bits) { if (NULL == bits) {
return bits; return bits;
} }
@ -611,6 +611,8 @@ MMDB_lookup_result_s MMDB_lookup_string(MMDB_s *const mmdb,
LOCAL int resolve_any_address(const char *ipstr, struct addrinfo **addresses) LOCAL int resolve_any_address(const char *ipstr, struct addrinfo **addresses)
{ {
struct addrinfo hints; struct addrinfo hints;
memset(&hints, 0, sizeof(addrinfo)); // getaddrinfo doesn't like garbage.
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
int gai_status; int gai_status;