TODO fix custom test (getPixelData should error)

This commit is contained in:
reeceal105988 committed 2026-11-05 15:10:10 +01:00
1 parent 1f08837b74
commit d9bb6fd600
2 files changed
+50 -2

No files matched your search

+3 -2
View File
@@ -24,7 +24,7 @@ static int openAndCheck(FILE **fd, const char *path)
status = 2;
goto ending_openAndCheck;
}
// size_t buf = 0;
if (!fread(headerRead, headerLen-1, 1, *fd))
{
fprintf(stderr, "Error: could not read file %s\n", path);
@@ -61,7 +61,8 @@ static int getUChar(FILE **fd, unsigned char *dest)
static int getPixelData(FILE **fd, const size_t bufSize, GrayScalePixelType *pixelData)
{
if (!fread((char *)pixelData, bufSize, 1, *fd))
size_t readLen = 0;
if (!(readLen = fread((char *)pixelData, bufSize, 1, *fd)) || readLen != 1)
return 1;
return 0;
}