Преглед изворни кода

This fixes an off by one in queue_avail which resulted in an assertion during testing.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@798 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake пре 20 година
родитељ
комит
0e50278a32
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      include/queue.h

+ 1 - 1
include/queue.h

@@ -164,7 +164,7 @@ static inline int queue_item_iterator_next (struct queue *queue)
 
 static inline void queue_avail (struct queue *queue, int *avail)
 {
-	*avail = queue->size - queue->used - 1;
+	*avail = queue->size - queue->used - 2;
 	assert (*avail >= 0);
 }