[git commit] Revert "libbb: remove unnecessary variable in xmalloc_fgets"

Denys Vlasenko vda.linux at googlemail.com
Sun Sep 2 16:35:29 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=0d598ab9f03dbf320f7b81c05e4a94cb303dfbc7
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

The variable is in fact necessary.

    commit 2da9724b56169f00bd7fb6b9a11c9409a7620981
    Author: Quentin Rameau <quinq at fifth.space>
    Date:   Sun Apr 1 17:05:35 2018 +0200
        libbb: remove unnecessary variable in xmalloc_fgets

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/get_line_from_file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index f3d6c6203..49ef093c2 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -47,7 +47,9 @@ char* FAST_FUNC bb_get_chunk_from_file(FILE *file, size_t *end)
 /* Get line, including trailing \n if any */
 char* FAST_FUNC xmalloc_fgets(FILE *file)
 {
-	return bb_get_chunk_from_file(file, NULL);
+	int i;
+
+	return bb_get_chunk_from_file(file, &i);
 }
 /* Get line.  Remove trailing \n */
 char* FAST_FUNC xmalloc_fgetline(FILE *file)


More information about the busybox-cvs mailing list