Revision: 2858 http://tmux.svn.sourceforge.net/tmux/?rev=2858&view=rev Author: tcunha Date: 2012-08-12 19:31:26 +0000 (Sun, 12 Aug 2012) Log Message: ----------- Sync OpenBSD patchset 1160:
Simplify width calculation (all numbers always sequential) and don't rely on uninitialized data, from Thomas Adam. Modified Paths: -------------- trunk/window-choose.c Modified: trunk/window-choose.c =================================================================== --- trunk/window-choose.c 2012-08-12 19:30:54 UTC (rev 2857) +++ trunk/window-choose.c 2012-08-12 19:31:26 UTC (rev 2858) @@ -80,7 +80,6 @@ { struct window_choose_mode_data *data = wp->modedata; struct window_choose_mode_item *item; - int width; char tmp[10]; ARRAY_EXPAND(&data->list, 1); @@ -90,9 +89,7 @@ item->wcd = wcd; item->pos = ARRAY_LENGTH(&data->list) - 1; - width = snprintf (tmp, sizeof tmp, "%u", item->pos); - if (width > data->width) - data->width = width; + data->width = snprintf (tmp, sizeof tmp , "%u", item->pos); } void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs