> if (entry1->time != entry2->time) > return entry1->time - entry2->time; > > Given that clog_entry_t->time is uint32_t what will happen if > entry2->time > entry1->time? return type is gint, so that should return correct (negative) values. But this cant be the reason for the segfault.