[buddy] Fix several PVS-Studio warnings

For #192.

* src/bddio.c, src/cppext.cxx, src/kernel.c: Fix printf formats, calls
to new, and simplify one check in bdd_delref_nc().
This commit is contained in:
Alexandre Duret-Lutz 2016-10-28 17:12:21 +02:00
parent 41b47966b0
commit 63818a3e69
3 changed files with 12 additions and 11 deletions

View file

@ -37,6 +37,7 @@
#include <string.h>
#include <stdlib.h>
#include <iomanip>
#include <new>
#include "kernel.h"
#include "bvecx.h"
@ -190,7 +191,7 @@ ostream &operator<<(ostream &o, const bdd &r)
return o;
}
int *set = new int[bddvarnum];
int *set = new (std::nothrow) int[bddvarnum];
if (set == NULL)
{
bdd_error(BDD_MEMORY);
@ -252,7 +253,7 @@ ostream &operator<<(ostream &o, const bdd &r)
return o;
}
int *set = new int[bddvarnum];
int *set = new (std::nothrow) int[bddvarnum];
if (set == NULL)
{
bdd_error(BDD_MEMORY);