bind plugin: space after realloc
[collectd.git] / src / network.c
index 6be4ed5..3f39aac 100644 (file)
@@ -1369,7 +1369,7 @@ static int parse_part_encr_aes256 (sockent_t *se, /* {{{ */
     warning_has_been_printed = 1;
   }
 
-  *ret_buffer += ph_length;
+  *ret_buffer = (void *) (((char *) *ret_buffer) + ph_length);
   *ret_buffer_size -= ph_length;
 
   return (0);
@@ -1408,7 +1408,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
                                (void *) buffer,
                                sizeof (pkg_type));
                memcpy ((void *) &pkg_length,
-                               (void *) (buffer + sizeof (pkg_type)),
+                               (void *) (((char *) buffer) + sizeof (pkg_type)),
                                sizeof (pkg_length));
 
                pkg_length = ntohs (pkg_length);
@@ -2501,7 +2501,7 @@ static int network_receive (void) /* {{{ */
                                break;
                        }
 
-                       ent->data = malloc (*ent->data);
+                       ent->data = malloc (network_config_packet_size);
                        if (ent->data == NULL)
                        {
                                sfree (ent);