fixed printing of %#H hosts
This commit is contained in:
@@ -120,6 +120,7 @@ static int print(FILE *stream, const struct printf_info *info,
|
|||||||
{
|
{
|
||||||
void *address;
|
void *address;
|
||||||
u_int16_t port;
|
u_int16_t port;
|
||||||
|
int len;
|
||||||
|
|
||||||
address = &this->address6.sin6_addr;
|
address = &this->address6.sin6_addr;
|
||||||
port = this->address6.sin6_port;
|
port = this->address6.sin6_port;
|
||||||
@@ -140,8 +141,9 @@ static int print(FILE *stream, const struct printf_info *info,
|
|||||||
}
|
}
|
||||||
else if (info->alt)
|
else if (info->alt)
|
||||||
{
|
{
|
||||||
snprintf(buffer, sizeof(buffer),
|
len = strlen(buffer);
|
||||||
"%s[%d]", buffer, ntohs(port));
|
snprintf(buffer + len, sizeof(buffer) - len,
|
||||||
|
"[%d]", ntohs(port));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user