over 9000 years of shame on me.

What where I thinking when I wrote that?!
This commit is contained in:
Godzil
2020-03-05 16:28:49 +00:00
parent e33cf0d5f0
commit 6bef6a1b77

View File

@@ -61,7 +61,7 @@ Canvas::Canvas(const char *imgfile)
{
printf("ERROR: Invalid file name '%s' - Can't determine the file format\n", imgfile);
}
else if (strncasecmp(fileExt, ".png", sizeof(fileExt)) == 0)
else if (strncasecmp(fileExt, ".png", strlen(fileExt)) == 0)
{
uint32_t ret = lodepng_decode24_file(&this->bitmap, &this->width, &this->height, imgfile);
if (ret)
@@ -69,7 +69,7 @@ Canvas::Canvas(const char *imgfile)
printf("ERROR: %s\n", lodepng_error_text(ret));
}
}
else if ( (strncasecmp(fileExt, ".jpg", sizeof(fileExt)) == 0) || (strncasecmp(fileExt, ".jpeg", sizeof(fileExt)) == 0) )
else if ( (strncasecmp(fileExt, ".jpg", strlen(fileExt)) == 0) || (strncasecmp(fileExt, ".jpeg", strlen(fileExt)) == 0) )
{
FILE *fp;
char *fileBuff;