i am a dumb dummy
[oweals/gnunet.git] / src / core / gnunet-service-core.c
index ac9a015d848a6cdc4fd9f8b2aecaa749d4c08302..76e26cc8f962ef02022ae18c26cb473c865e7a37 100644 (file)
@@ -3296,9 +3296,9 @@ update_neighbour_performance (struct Neighbour *n,
 
   if (ats_count == 0)
     return;
-  for (i=0;i<ats_count;i++)
+  for (i = 0; i < ats_count; i++)
     {
-      for (j=0;j<n->ats_count;j++)
+      for (j=0;j < n->ats_count; j++)
        {
          if (n->ats[j].type == ats[i].type)
            {
@@ -3306,10 +3306,12 @@ update_neighbour_performance (struct Neighbour *n,
              break;
            }
        }
-      if (j == n->ats_count)   
-       GNUNET_array_append (n->ats,
-                            n->ats_count,
-                            *ats);     
+      if (j == n->ats_count)
+        {
+          GNUNET_array_append (n->ats,
+                               n->ats_count,
+                               ats[i]);
+        }
     }
 }
 
@@ -3763,7 +3765,7 @@ send_p2p_message_to_client (struct Neighbour *sender,
                             const void *m, size_t msize)
 {
   size_t size = msize + sizeof (struct NotifyTrafficMessage) +
-    (sender->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+    (sender->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
   char buf[size];
   struct NotifyTrafficMessage *ntm;
   struct GNUNET_TRANSPORT_ATS_Information *ats;
@@ -3776,7 +3778,7 @@ send_p2p_message_to_client (struct Neighbour *sender,
                         sender->ats_count,
                         0);
       size = msize + sizeof (struct NotifyTrafficMessage) +
-       (sender->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+       (sender->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
     }
 #if DEBUG_CORE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,