summaryrefslogtreecommitdiff
path: root/libbb/fgets_str.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-12 19:29:44 +0000
committerDenis Vlasenko2006-10-12 19:29:44 +0000
commita6dbb08a48903cb8f31fad2cf2d1cffa92bd4808 (patch)
treef7f2113941a2dc0385080baa7656ead41f45f834 /libbb/fgets_str.c
parent12f5676cce3b2e04668df3f18f94f1a3c7fdbb9e (diff)
downloadbusybox-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.zip
busybox-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.tar.gz
small style fixes
Diffstat (limited to 'libbb/fgets_str.c')
-rw-r--r--libbb/fgets_str.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c
index 8f06fa5..41370d1 100644
--- a/libbb/fgets_str.c
+++ b/libbb/fgets_str.c
@@ -44,12 +44,14 @@ char *fgets_str(FILE *file, const char *terminating_string)
/* Check for terminating string */
end_string_offset = idx - term_length;
- if ((end_string_offset > 0) && (memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0)) {
+ if (end_string_offset > 0
+ && memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0
+ ) {
idx -= term_length;
break;
}
}
+ linebuf = xrealloc(linebuf, idx + 1);
linebuf[idx] = '\0';
- return(linebuf);
+ return linebuf;
}
-