# HG changeset patch # User rubidium # Date 2013-11-26 13:27:34 # Node ID 2edcba17b807b47280074f6c294f623efc6f15bb # Parent 9875f8f322340488c58925c4a98e623b6c3bfcb9 (svn r26123) -Fix: make sure the maximum row length when making company buttons is at least 1 diff --git a/src/widget.cpp b/src/widget.cpp --- a/src/widget.cpp +++ b/src/widget.cpp @@ -2835,6 +2835,7 @@ NWidgetContainer *MakeWindowNWidgetTree( */ NWidgetBase *MakeCompanyButtonRows(int *biggest_index, int widget_first, int widget_last, int max_length, StringID button_tooltip) { + assert(max_length >= 1); NWidgetVertical *vert = NULL; // Storage for all rows. NWidgetHorizontal *hor = NULL; // Storage for buttons in one row. int hor_length = 0;