{
int n;
GLubyte* pixels;
+ size_t num_read;
FILE* infile = fopen( filename, "rb" );
exit(1);
}
- fread( width, sizeof( GLsizei ), 1, infile );
- fread( height, sizeof( GLsizei ), 1, infile );
+ num_read = fread( width, sizeof( GLsizei ), 1, infile );
+ assert(num_read == 1);
+ num_read = fread( height, sizeof( GLsizei ), 1, infile );
+ assert(num_read == 1);
*width = bswap(*width);
*height = bswap(*height);
return NULL;
}
- fread( pixels, sizeof( GLubyte ), n, infile );
+ num_read = fread( pixels, sizeof( GLubyte ), n, infile );
+ assert(num_read == n);
fclose( infile );
{
int n;
GLubyte* pixels;
+ size_t num_read;
FILE* infile = fopen( filename, "rb" );
exit(1);
}
- fread( width, sizeof( GLsizei ), 1, infile );
- fread( height, sizeof( GLsizei ), 1, infile );
+ num_read = fread( width, sizeof( GLsizei ), 1, infile );
+ assert(num_read == 1);
+ num_read = fread( height, sizeof( GLsizei ), 1, infile );
+ assert(num_read == 1);
*width = bswap(*width);
*height = bswap(*height);
return NULL;
}
- fread( pixels, sizeof( GLubyte ), n, infile );
+ num_read = fread( pixels, sizeof( GLubyte ), n, infile );
+ assert(num_read == n);
fclose( infile );
*/
#include <GL/glew.h>
#include <GL/glut.h>
+#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
{
int n;
GLubyte* pixels;
+ size_t num_read;
FILE* infile = fopen( filename, "rb" );
return NULL;
}
- fread( width, sizeof( GLsizei ), 1, infile );
- fread( height, sizeof( GLsizei ), 1, infile );
+ num_read = fread( width, sizeof( GLsizei ), 1, infile );
+ assert(num_read == 1);
+ num_read = fread( height, sizeof( GLsizei ), 1, infile );
+ assert(num_read == 1);
*width = bswap(*width);
*height = bswap(*height);
return NULL;
}
- fread( pixels, sizeof( GLubyte ), n, infile );
+ num_read = fread( pixels, sizeof( GLubyte ), n, infile );
+ assert(num_read == n);
fclose( infile );