From 05465d4d9a11f78c867658f02074635d9cbe9aa3 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 28 May 2008 20:06:00 +0000 Subject: [PATCH] (svn r13315) -Fix (r13314): Assert if no engines or wagons available --- src/engine_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index c9bd056505..edbc0a8abf 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -214,9 +214,9 @@ void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare) */ 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); }