diff --git a/src/base/abci/abcDec.c b/src/base/abci/abcDec.c index a495cefcd..919a46deb 100644 --- a/src/base/abci/abcDec.c +++ b/src/base/abci/abcDec.c @@ -91,7 +91,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit ) void Abc_TruthReadHex( word * pTruth, char * pString, int nVars ) { int nWords = (nVars < 7)? 1 : (1 << (nVars-6)); - int k, Digit, nDigits = (nWords << 4); + int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4); char EndSymbol; // skip the first 2 symbols if they are "0x" if ( pString[0] == '0' && pString[1] == 'x' ) diff --git a/src/base/abci/abcRpo.c b/src/base/abci/abcRpo.c index 286ef80b3..47c033b42 100644 --- a/src/base/abci/abcRpo.c +++ b/src/base/abci/abcRpo.c @@ -96,7 +96,7 @@ static inline void Abc_TruthWriteHexDigit(FILE * pFile, int HexDigit) { static void Abc_TruthReadHex(word * pTruth, char * pString, int nVars) { int nWords = (nVars < 7) ? 1 : (1 << (nVars - 6)); - int k, Digit, nDigits = (nWords << 4); + int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4); char EndSymbol; // skip the first 2 symbols if they are "0x" if (pString[0] == '0' && pString[1] == 'x') diff --git a/src/bool/lucky/luckyRead.c b/src/bool/lucky/luckyRead.c index cf8e57d4a..10c581703 100644 --- a/src/bool/lucky/luckyRead.c +++ b/src/bool/lucky/luckyRead.c @@ -56,7 +56,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit ) static inline void Abc_TruthReadHex( word * pTruth, char * pString, int nVars ) { int nWords = (nVars < 7)? 1 : (1 << (nVars-6)); - int k, Digit, nDigits = (nWords << 4); + int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4); char EndSymbol; // skip the first 2 symbols if they are "0x" if ( pString[0] == '0' && pString[1] == 'x' )