ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit b2a28f96ea6400c955650b71377d36b2cfb85f4b
parent d07b7d01d0c1e48be4b2df55ee6cedbc2a452a1e
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun, 18 Dec 2016 00:08:15 +0100

Leave room for a trailing NUL character

Diffstat:
Msrc/main.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c @@ -289,7 +289,7 @@ int main(int argc, char *argv[]) { unsigned char *inputFileBuffer; // allocate memory to contain the whole file - inputFileBuffer = (unsigned char *) malloc(sizeof(unsigned char)*inputFileSize); + inputFileBuffer = (unsigned char *) malloc(sizeof(unsigned char)*inputFileSize + 1); if (inputFileBuffer == NULL) { fputs ("\nMemory error.\n\n", stderr); exit (2); }