+// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2011 Free Electrons
* David Wagner <david.wagner@free-electrons.com>
* Inspired from envcrc.c:
* (C) Copyright 2001
* Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <errno.h>
txt_fd = STDIN_FILENO;
do {
- filebuf = realloc(filebuf, readlen);
+ filebuf = realloc(filebuf, filesize + readlen);
if (!filebuf) {
fprintf(stderr, "Can't realloc memory for the input file buffer\n");
return EXIT_FAILURE;