Fixed null pointer seg fault in cmp function.
FossilOrigin-Name: d0d1763f670212506f67155c605b0d693ba79c9b3ab51cd669e1495aa2a10978
This commit is contained in:
parent
bc4aa16f9b
commit
25cd668ca7
@ -149,7 +149,20 @@ static int cw_action_out_cmp(const void *elem1, const void *elem2)
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
r = strcmp(e1->item_id, e2->item_id);
|
||||
if (!e1->item_id && !e2->item_id){
|
||||
r=0;
|
||||
}
|
||||
else{
|
||||
if (!e1->item_id) {
|
||||
r = strcmp("", e2->item_id);
|
||||
}
|
||||
else if (!e2->item_id){
|
||||
r = strcmp(e1->item_id,"");
|
||||
}
|
||||
else{
|
||||
r = strcmp(e1->item_id, e2->item_id);
|
||||
}
|
||||
}
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user