Skip to content

Commit

Permalink
bugfix: added initialization of pnminfo->loader; this fixes #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Szabo committed Feb 27, 2018
1 parent beea3bd commit 1e43ec5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions input-pnm.ci
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,15 @@ bitmap_type pnm_load_image (at_string filename)
FATALP ("PNM: is not a valid file");

/* Look up magic number to see what type of PNM this is */
pnminfo->loader = NULL;
for (ctr=0; pnm_types[ctr].name; ctr++)
if (buf[1] == pnm_types[ctr].name)
{
pnminfo->np = pnm_types[ctr].np;
pnminfo->asciibody = pnm_types[ctr].asciibody;
pnminfo->maxval = pnm_types[ctr].maxval;
pnminfo->loader = pnm_types[ctr].loader;
break;
}
if (!pnminfo->loader)
FATALP ("PNM: file not in a supported format");
Expand Down

0 comments on commit 1e43ec5

Please sign in to comment.