[hackers] [sbase] getlines: Style fix || sin

From: <git_AT_suckless.org>
Date: Wed, 11 Feb 2015 01:29:13 +0100 (CET)

commit 9276a4860fd4c2693ac70b0deb6b56a030b27e14
Author: sin <sin_AT_2f30.org>
Date: Wed Feb 11 00:27:30 2015 +0000

    getlines: Style fix

diff --git a/libutil/getlines.c b/libutil/getlines.c
index 8d4fc44..95ce0b9 100644
--- a/libutil/getlines.c
+++ b/libutil/getlines.c
_AT_@ -20,13 +20,13 @@ getlines(FILE *fp, struct linebuf *b)
                         b->lines = nline;
                 }
                 linelen = len + 1;
- b->lines[b->nlines-1] = emalloc(linelen);
- memcpy(b->lines[b->nlines-1], line, linelen);
+ b->lines[b->nlines - 1] = emalloc(linelen);
+ memcpy(b->lines[b->nlines - 1], line, linelen);
         }
         free(line);
- if (strchr(b->lines[b->nlines-1], '\n') == NULL) {
- b->lines[b->nlines-1] = erealloc(b->lines[b->nlines-1], linelen + 1);
- b->lines[b->nlines-1][linelen-1] = '\n';
- b->lines[b->nlines-1][linelen] = '\0';
+ if (!strchr(b->lines[b->nlines - 1], '\n')) {
+ b->lines[b->nlines - 1] = erealloc(b->lines[b->nlines - 1], linelen + 1);
+ b->lines[b->nlines - 1][linelen - 1] = '\n';
+ b->lines[b->nlines - 1][linelen] = '\0';
         }
 }
Received on Wed Feb 11 2015 - 01:29:13 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 11 2015 - 01:36:18 CET