Commit 51e6b90f authored by Simon Marlow's avatar Simon Marlow

fix the build when !USE_MMAP

parent 69db8adf
......@@ -1464,7 +1464,6 @@ loadObj( char *path )
close(fd);
#else /* !USE_MMAP */
/* load the image into memory */
f = fopen(path, "rb");
if (!f)
......@@ -1492,10 +1491,12 @@ loadObj( char *path )
oc->image = stgMallocBytes(oc->fileSize, "loadObj(image)");
# endif
n = fread ( oc->image, 1, oc->fileSize, f );
if (n != oc->fileSize)
barf("loadObj: error whilst reading `%s'", path);
{
int n;
n = fread ( oc->image, 1, oc->fileSize, f );
if (n != oc->fileSize)
barf("loadObj: error whilst reading `%s'", path);
}
fclose(f);
#endif /* USE_MMAP */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment