[hackers] [sbase] libutil/getlines: style fix || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sun, 29 Mar 2015 22:09:13 +0200 (CEST)

commit 27f258dd3483ba894e047f9394fdf8c484e14b48
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun Mar 29 21:55:34 2015 +0200

    libutil/getlines: style fix

diff --git a/libutil/getlines.c b/libutil/getlines.c
index 942232d..820c781 100644
--- a/libutil/getlines.c
+++ b/libutil/getlines.c
_AT_@ -22,9 +22,7 @@ getlines(FILE *fp, struct linebuf *b)
                 b->lines[b->nlines - 1] = memcpy(emalloc(linelen), line, linelen);
         }
         free(line);
- if(!b->nlines || !b->lines)
- return;
- if (!strchr(b->lines[b->nlines - 1], '\n')) {
+ if (b->lines && b->nlines && !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 Sun Mar 29 2015 - 22:09:13 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 29 2015 - 22:12:18 CEST