On 2011-12-17 22:44, Kostik Belousov wrote:
>>  #define MAXWIDTH  132
>>  #define MAXREP    10
>> @@ -115,7 +116,7 @@ main(int argc, char *argv[])
>>                      acctfile = cp;
>>      }
>>  
>> -    for (cp = buf[0], limit = buf[MAXREP]; cp < limit; *cp++ = ' ');
>> +    memset(buf, ' ', sizeof(buf));
>>      done = 0;
> buf is two-dimensional array. This change looks wrong.

The for loop took the address of the left-top corner of the
two-dimensional array, and iterated with a char pointer to the address
just after the right-bottom corner of the array.  It was in effect a
memset, just hand-written.
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to