stdint fixes

This commit is contained in:
van Hauser 2017-07-06 22:25:09 +02:00
parent 7613700a5a
commit 11176a1080
3 changed files with 32 additions and 27 deletions

View file

@ -1215,11 +1215,13 @@ char *hydra_address2string(char *address) {
#ifdef AF_INET6
if (address[0] == 16) {
memcpy(&target6.sin6_addr, &address[1], 16);
inet_ntop(AF_INET6, &target6.sin6_addr, ipstring, sizeof(ipstring));
ipstring[0] = '[
inet_ntop(AF_INET6, &target6.sin6_addr, ipstring + 1, sizeof(ipstring) - 1);
if (address[17] != 0) {
strcat(ipstring, "%");
strcat(ipstring, address + 17);
}
strcat(ipstring, "]");
return ipstring;
} else
#endif