added fetching PI to expression parser, fixed compilation warning

This commit is contained in:
FeralChild64 committed 2020-07-20 15:26:48 +02:00
1 parent a70ce20f30
commit cfc970e21a
4 files changed
+28 -17

No files matched your search

+4 -1
View File
@@ -108,13 +108,16 @@ void abort_(const char * s, ...)
void read_png_file(char* file_name)
{
unsigned char header[8]; // 8 is the maximum size that can be checked
size_t readResult;
/* open file and test for it being a png */
infile = fopen(file_name, "rb");
if (infile == NULL)
abort_("[read_png_file] File %s could not be opened for reading", file_name);
fread(header, 1, 8, infile);
readResult = fread(header, 1, 8, infile);
if (readResult != 8)
abort_("[read_png_file] File %s could not be read", file_name);
if (png_sig_cmp(header, 0, 8))
abort_("[read_png_file] File %s is not recognized as a PNG file", file_name);