aboutsummaryrefslogtreecommitdiff
path: root/libbb/get_line_from_file.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-12 00:32:05 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-12 00:32:05 +0000
commit51742f4bb0c57a4d5063ece9437a2f34a42e52c8 (patch)
tree7a912fc65ff43bdb09078d75bfc02ad8f5380b47 /libbb/get_line_from_file.c
parent50f7f446ecaadef6895a4ee601567e0b68330637 (diff)
downloadbusybox-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.tar.gz
style fixes. No code changes
Diffstat (limited to 'libbb/get_line_from_file.c')
-rw-r--r--libbb/get_line_from_file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index 2c9608e9e..1eb4af13c 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -17,7 +17,7 @@
* end of line. If end isn't NULL, length of the chunk read is stored in it.
* Return NULL if EOF/error */
-char *bb_get_chunk_from_file(FILE * file, int *end)
+char *bb_get_chunk_from_file(FILE *file, int *end)
{
int ch;
int idx = 0;
@@ -27,7 +27,8 @@ char *bb_get_chunk_from_file(FILE * file, int *end)
while ((ch = getc(file)) != EOF) {
/* grow the line buffer as necessary */
if (idx >= linebufsz) {
- linebuf = xrealloc(linebuf, linebufsz += 80);
+ linebufsz += 80;
+ linebuf = xrealloc(linebuf, linebufsz);
}
linebuf[idx++] = (char) ch;
if (!ch || (end && ch == '\n'))
@@ -49,7 +50,7 @@ char *bb_get_chunk_from_file(FILE * file, int *end)
}
/* Get line, including trailing \n if any */
-char *xmalloc_fgets(FILE * file)
+char *xmalloc_fgets(FILE *file)
{
int i;
@@ -57,7 +58,7 @@ char *xmalloc_fgets(FILE * file)
}
/* Get line. Remove trailing \n */
-char *xmalloc_getline(FILE * file)
+char *xmalloc_getline(FILE *file)
{
int i;
char *c = bb_get_chunk_from_file(file, &i);