ansilove

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

commit a6da7c3090c59e28c4c32e7072d193111af0b05e
parent f579dd46be04685f8a38a06036330e3270579d61
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 22 Jul 2016 12:46:30 +0200

Use stat to get input file size instead of custom file size function

Diffstat:
Msrc/main.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c @@ -10,6 +10,7 @@ // #define _XOPEN_SOURCE 700 +#include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -290,7 +291,9 @@ int main(int argc, char *argv[]) { } // get the file size (bytes) - size_t input_file_size = filesize(input); + struct stat input_file_stat; + stat (input, &input_file_stat); + size_t input_file_size=input_file_stat.st_size; // next up is loading our file into a dynamically allocated memory buffer unsigned char *input_file_buffer;