# HG changeset patch # User peter1138 # Date 2008-05-28 20:06:00 # Node ID f74e13f5c66ef7c24331612aff54a68f5fc88b2f # Parent e5bffa930a63ee7511fa0abc77e0710a5ccbd0c3 (svn r13315) -Fix (r13314): Assert if no engines or wagons available diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -214,9 +214,9 @@ void EngList_Sort(GUIEngineList *el, Eng */ void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items) { + if (num_items < 2) return; assert(begin < el->Length()); assert(begin + num_items <= el->Length()); - if (num_items < 2) return; qsort(el->Get(begin), num_items, sizeof(*el->Begin()), compare); }