Revert "libbb: remove unnecessary variable in xmalloc_fgets"
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 2 Sep 2018 16:35:29 +0000 (18:35 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 2 Sep 2018 16:35:29 +0000 (18:35 +0200)
The variable is in fact necessary.

    commit 2da9724b56169f00bd7fb6b9a11c9409a7620981
    Author: Quentin Rameau <quinq@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@googlemail.com>
libbb/get_line_from_file.c

index f3d6c62039e969866e627e49ae90ab472d9b5ae9..49ef093c2531459d294012cb54bd5c0768f46c49 100644 (file)
@@ -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)