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?
+ 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");
