* src/bddio.c (bdd_load): Check the return value of fscanf() to
kill a warning.
This commit is contained in:
Alexandre Duret-Lutz 2010-01-21 15:51:23 +01:00
parent e663c222e5
commit e20ba143bb
2 changed files with 31 additions and 24 deletions

View file

@ -1,3 +1,8 @@
2010-01-21 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* src/bddio.c (bdd_load): Check the return value of fscanf() to
kill a warning.
2009-12-09 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Inline bdd_addref() and bdd_delref() to speedup BDD operations.

View file

@ -496,14 +496,16 @@ int bdd_load(FILE *ifile, BDD *root)
/* Check for constant true / false */
if (lh_nodenum==0 && vnum==0)
{
fscanf(ifile, "%d", root);
if (fscanf(ifile, "%d", root) != 1)
return bdd_error(BDD_FORMAT);
return 0;
}
if ((loadvar2level=(int*)malloc(sizeof(int)*vnum)) == NULL)
return bdd_error(BDD_MEMORY);
for (n=0 ; n<vnum ; n++)
fscanf(ifile, "%d", &loadvar2level[n]);
if (fscanf(ifile, "%d", &loadvar2level[n]) != 1)
return bdd_error(BDD_FORMAT);
if (vnum > bddvarnum)
bdd_setvarnum(vnum);