[hackers] [sbase] paste: Minor style tweaks || Michael Forney

From: <git_AT_suckless.org>
Date: Thu, 16 Apr 2020 01:17:42 +0200 (CEST)

commit 92f17ad648114ce6bf967d890053d5b6b8504c28
Author: Michael Forney <mforney_AT_mforney.org>
AuthorDate: Wed Apr 15 16:13:22 2020 -0700
Commit: Michael Forney <mforney_AT_mforney.org>
CommitDate: Wed Apr 15 16:13:22 2020 -0700

    paste: Minor style tweaks
    
    Convert for-loop with no initial or continue expression into a
    while-loop.
    
    Drop unnecessary parentheses.

diff --git a/paste.c b/paste.c
index 0385efa..4fa9fc5 100644
--- a/paste.c
+++ b/paste.c
_AT_@ -51,10 +51,10 @@ nextline:
                 d = delim[i % delimlen];
                 c = 0;
 
- for (; efgetrune(&c, dsc[i].fp, dsc[i].name) ;) {
+ while (efgetrune(&c, dsc[i].fp, dsc[i].name)) {
                         for (m = last + 1; m < i; m++) {
                                 if (delim[m % delimlen] != '\0')
- efputrune(&(delim[m % delimlen]), stdout, "<stdout>");
+ efputrune(&delim[m % delimlen], stdout, "<stdout>");
                         }
                         last = i;
                         if (c == '\n') {
Received on Thu Apr 16 2020 - 01:17:42 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 16 2020 - 01:24:34 CEST