[buddy]
* src/bddio.c (bdd_load): Check the return value of fscanf() to kill a warning.
This commit is contained in:
parent
e663c222e5
commit
e20ba143bb
2 changed files with 31 additions and 24 deletions
|
|
@ -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>
|
2009-12-09 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
Inline bdd_addref() and bdd_delref() to speedup BDD operations.
|
Inline bdd_addref() and bdd_delref() to speedup BDD operations.
|
||||||
|
|
|
||||||
|
|
@ -496,14 +496,16 @@ int bdd_load(FILE *ifile, BDD *root)
|
||||||
/* Check for constant true / false */
|
/* Check for constant true / false */
|
||||||
if (lh_nodenum==0 && vnum==0)
|
if (lh_nodenum==0 && vnum==0)
|
||||||
{
|
{
|
||||||
fscanf(ifile, "%d", root);
|
if (fscanf(ifile, "%d", root) != 1)
|
||||||
|
return bdd_error(BDD_FORMAT);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((loadvar2level=(int*)malloc(sizeof(int)*vnum)) == NULL)
|
if ((loadvar2level=(int*)malloc(sizeof(int)*vnum)) == NULL)
|
||||||
return bdd_error(BDD_MEMORY);
|
return bdd_error(BDD_MEMORY);
|
||||||
for (n=0 ; n<vnum ; n++)
|
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)
|
if (vnum > bddvarnum)
|
||||||
bdd_setvarnum(vnum);
|
bdd_setvarnum(vnum);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue