Ensure we don't write outside the pref_str in put_string_list().

This bug was introduced in revision 31487, when putting each
column.format entry on separate lines.

svn path=/trunk/; revision=31653
This commit is contained in:
Stig Bjørlykke 2010-01-25 10:22:00 +00:00
parent cbd20099ef
commit 17a01968d9
1 changed files with 1 additions and 1 deletions

View File

@ -934,7 +934,7 @@ put_string_list(GList *sl)
if ((fmt_len + cur_len) < (MAX_FMT_PREF_LEN - 1)) {
if (item_count % 2) {
/* Wrap the line. */
cur_len--;
if (cur_len > 0) cur_len--;
cur_pos = 0;
pref_str[cur_len] = '\n'; cur_len++;
pref_str[cur_len] = '\t'; cur_len++;