Skip to content

Commit cfb5450

Browse files
committed
Fix typo and obviously wrong
This commit fix my careless of submitting commit. - q_insert_head - merge_two_list Change-Id: I43eb51ae34171eacbf5796b0226916ab634d3739
1 parent fcf15dc commit cfb5450

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

queue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool q_insert_head(struct list_head *head, char *s)
6666
bool q_insert_tail(struct list_head *head, char *s)
6767
{
6868
if (!head)
69-
return NULL;
69+
return false;
7070
element_t *e = element_new(s);
7171
if (!e)
7272
return false;
@@ -279,7 +279,7 @@ void merge_two_list(struct list_head *l, struct list_head *r, bool descend)
279279

280280
struct list_head *l_curr = l->next;
281281

282-
while (!r || list_empty(r)) {
282+
while (r && !list_empty(r)) {
283283
const element_t *l_ele = list_entry(l_curr, element_t, list);
284284
element_t *r_ele = list_first_entry(r, element_t, list);
285285

0 commit comments

Comments
 (0)