Commit ba2870aa authored by Antonio Pena Monferrer's avatar Antonio Pena Monferrer Committed by Pavan Balaji

Fix a bug in GENERIC_Q_SEARCH_REMOVE + empty queue

In case it's empty, it has to return with a NULL element pointer.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent c059963a
......@@ -113,8 +113,10 @@
#define GENERIC_Q_SEARCH_REMOVE(qp, pred, epp, el_type, next_field) do { \
el_type *_e; \
el_type *_prev; \
if (GENERIC_Q_EMPTY(*(qp))) \
if (GENERIC_Q_EMPTY(*(qp))) { \
*(epp) = NULL; \
break; \
} \
_e = GENERIC_Q_HEAD(*(qp)); \
if (pred) \
{ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment