tTiny bit of optimisation - skroll - scroll a text to stdout
 (HTM) git clone git://z3bra.org/skroll
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit f260f33ccd2ca8852c7d14aa51b6d063ff184f5a
 (DIR) parent 7ef68be148e2096c510eabc70302341c3c6540dd
 (HTM) Author: z3bra <willy@mailoo.org>
       Date:   Mon,  3 Nov 2014 15:37:13 +0100
       
       Tiny bit of optimisation
       
       Diffstat:
         M skroll.c                            |       9 ++++-----
       
       1 file changed, 4 insertions(+), 5 deletions(-)
       ---
 (DIR) diff --git a/skroll.c b/skroll.c
       t@@ -37,8 +37,8 @@ void skroll (const char *input)
            do
            {
                /*
       -         * each step of the loop will print the buffer, one byte further after each step.
       -         * using a carriage return, it makes the text scroll out. Magic..
       +         * each step of the loop will print the buffer, one byte further after
       +         * each step. using a carriage return, it makes the text scroll out.
                 * leading/ending spaces are here to make sure that the text goes from
                 * far right, and goes all the way to far left
                 */
       t@@ -46,11 +46,10 @@ void skroll (const char *input)
                {
        
                    /* print out `number` characters from the buffer ! */
       -            putc('\r', stdout);
                    write(1, input + offset, number);
        
       -            /* if we want a new line, let's do it here */
       -            if (newline) putc('\n', stdout);
       +            /* if we want a new line, do it here, otherwise, carriage return */
       +            putc(newline ? '\n' : '\r', stdout);
        
                    /* flush stdout, and wait for the next step */
                    fflush(stdout);