[hackers] [sbase] getlines: Style fix || sin
commit 51680535ce4d929a40e2ffa85d64c2aa6f57f90f
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 Tue Mar 24 2015 - 23:53:40 CET
This archive was generated by hypermail 2.3.0
: Wed Mar 25 2015 - 00:08:53 CET