[hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-24 Thread git
commit fbda47b96470c2c9278cf4902fb517a2882137b4 Author: FRIGN d...@frign.de Date: Mon Mar 16 19:26:42 2015 +0100 Rewrite foldline() in fold(1) After the audit, I had this noted down as a TODO-item, but considered the function to be tested enough to hold the line until I

Re: [hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-17 Thread FRIGN
On Tue, 17 Mar 2015 11:35:33 +0100 Roberto E. Vargas Caballero k...@shike2.com wrote: Hey Roberto, It's a bit strange this fwrite, why don't you use putchar there? Look again, we write 'off' bytes, not 1. and why you check the return value of fwrite, but not the return value of putchar or

Re: [hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-17 Thread Dimitris Papastamos
On Tue, Mar 17, 2015 at 11:35:33AM +0100, Roberto E. Vargas Caballero wrote: Hi, + for (p = str, col = 0; *p *p != '\n'; p++) { + if (!UTF8_POINT(*p) !bflag) + continue; + if (col = width) { + off = (sflag spacesect) ?

Re: [hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-17 Thread Roberto E. Vargas Caballero
Hi, + for (p = str, col = 0; *p *p != '\n'; p++) { + if (!UTF8_POINT(*p) !bflag) + continue; + if (col = width) { + off = (sflag spacesect) ? spacesect - str : p - str; + if (fwrite(str, 1, off,

[hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-17 Thread git
commit 9d151741258d6e2f7eb415b8783a2c2a9efbda04 Author: FRIGN d...@frign.de Date: Mon Mar 16 19:26:42 2015 +0100 Rewrite foldline() in fold(1) After the audit, I had this noted down as a TODO-item, but considered the function to be tested enough to hold the line until I