Fix compiler warnings

This commit is contained in:
Peter Eisentraut 2015-03-13 01:22:26 -04:00
parent fae032efc9
commit fe24ad277f
1 changed files with 2 additions and 2 deletions

4
uri.c
View File

@ -141,7 +141,7 @@ uri_host_inet(PG_FUNCTION_ARGS)
parse_uri(s, &uri); parse_uri(s, &uri);
if (uri.hostData.ip4) if (uri.hostData.ip4)
{ {
unsigned char *data = uri.hostData.ip4; unsigned char *data = uri.hostData.ip4->data;
char *tmp = palloc(16); char *tmp = palloc(16);
snprintf(tmp, 16, "%u.%u.%u.%u", data[0], data[1], data[2], data[3]); snprintf(tmp, 16, "%u.%u.%u.%u", data[0], data[1], data[2], data[3]);
uriFreeUriMembersA(&uri); uriFreeUriMembersA(&uri);
@ -149,7 +149,7 @@ uri_host_inet(PG_FUNCTION_ARGS)
} }
else if (uri.hostData.ip6) else if (uri.hostData.ip6)
{ {
unsigned char *data = uri.hostData.ip6; unsigned char *data = uri.hostData.ip6->data;
char *tmp = palloc(40); char *tmp = palloc(40);
snprintf(tmp, 40, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", snprintf(tmp, 40, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
data[0], data[1], data[2], data[3], data[0], data[1], data[2], data[3],