On Wed, Jun 15, 2011 at 4:03 AM, Jakob Gruber <jakob.gruber@gmail.com> wrote:
On 06/14/2011 12:11 AM, Dan McGee wrote:
+ const char *str = alpm_list_getdata(list); + printf("%s", str); + cols += string_length(str); + for(i = alpm_list_next(list), cols = len; i; i = alpm_list_next(i)) {
cols is assigned and then overwritten in the next line? Definite oversight here; removing the assignment from the for() should take care of any issue here, it appears.
+ const char *str = alpm_list_getdata(i); int s = string_length(str); - if(cols + s + 2>= maxcols) { + /* wrap only if we have enough usable column space */ + if(maxcols> len&& cols + s + 2>= maxcols) { int j; cols = len; printf("\n");