-ignore
[oweals/gnunet.git] / src / gns / nss / nss_gns_query.c
index 1eadff0ce4712fdbde559a4766ce46705df105ef..11356c2160bd9c21fc5408b4d4abe9093a4de355 100644 (file)
@@ -46,8 +46,11 @@ int gns_resolve_name(int af, const char *name, struct userdata *u)
         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);
@@ -57,8 +60,11 @@ int gns_resolve_name(int af, const char *name, struct userdata *u)
         }
         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);