From 5c864a030dc8fca666eb15ce0af0f3c7b620489c Mon Sep 17 00:00:00 2001 From: Rumble Date: Sat, 3 May 2014 19:54:05 -0400 Subject: [PATCH] Update utils.c --- src/utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index c0b8594..52b9cc0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -983,7 +983,8 @@ void char_from_furniture(struct char_data *ch) */ void column_list(struct char_data *ch, int num_cols, const char **list, int list_length, bool show_nums) { - int num_per_col, col_width,r,c,i, offset=0, len=0, temp_len, max_len=0; + size_t max_len = 0; + int num_per_col, col_width,r,c,i, offset=0, len=0, temp_len; char buf[MAX_STRING_LENGTH]; /* Work out the longest list item */ @@ -1010,7 +1011,7 @@ void column_list(struct char_data *ch, int num_cols, const char **list, int list if (show_nums) col_width-=4; - if (col_width < max_len) + if (col_width < 0 || (size_t)col_width < max_len) log("Warning: columns too narrow for correct output to %s in simple_column_list (utils.c)", GET_NAME(ch)); /* Calculate how many list items there should be per column */