line[strlen(line)-1] = '\0';
if (af == AF_INET)
{
- if (inet_pton(af, line, &(u->data.ipv4[u->count++])))
+ if (inet_pton(af, line, &(u->data.ipv4[u->count])))
+ {
+ u->count++;
u->data_len += sizeof(ipv4_address_t);
+ }
else
{
fclose (p);
}
else if ((af == AF_INET6))
{
- if (inet_pton(af, line, &(u->data.ipv6[u->count++])))
+ if (inet_pton(af, line, &(u->data.ipv6[u->count])))
+ {
+ u->count++;
u->data_len += sizeof(ipv6_address_t);
+ }
else
{
fclose (p);