summaryrefslogtreecommitdiff
path: root/broccoli
diff options
context:
space:
mode:
Diffstat (limited to 'broccoli')
-rw-r--r--broccoli/fifoqueue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/broccoli/fifoqueue.c b/broccoli/fifoqueue.c
index dfb8464..e8a1525 100644
--- a/broccoli/fifoqueue.c
+++ b/broccoli/fifoqueue.c
@@ -54,7 +54,7 @@ add_to_queue(Fifo_q * q, Sensor_t * sensor)
else if(is_full(q)){
return -1;
}
- Queue_t * new_elem = (Queue_t *) malloc(sizeof(Queue_t *));
+ Queue_t * new_elem = (Queue_t *) malloc(sizeof(Queue_t));
new_elem->next = NULL;
new_elem->sensor = sensor;
if(is_empty(q)){
@@ -78,7 +78,7 @@ pop_from_queue(Fifo_q * q)
}
pthread_mutex_lock(&lock);
Queue_t * head = q->head;
- q->head = q->head->next;
+ q->head = head->next;
Sensor_t * sensor = head->sensor;
free(head);
q->currentSize--;
@@ -88,7 +88,7 @@ pop_from_queue(Fifo_q * q)
Sensor_t *
create_sensor_object(int value, int uid){
- Sensor_t * sensor = (Sensor_t *) malloc(sizeof(Sensor_t *));
+ Sensor_t * sensor = (Sensor_t *) malloc(sizeof(Sensor_t));
sensor->value = value;
sensor->uid = uid;
return sensor;