From ff5d3591d1e7d90199d7395cde9fc6d902ed4b41 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 15 Sep 2013 18:23:49 -0700 Subject: Infrastructure to support full Liberty format and unitification of library representations. --- src/misc/extra/extraUtilFile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/misc/extra/extraUtilFile.c') diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 2e1d60f4..d514f862 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -551,7 +551,7 @@ void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars ) // write the number into the file fprintf( pFile, "0x" ); nMints = (1 << nVars); - nDigits = nMints / 4; + nDigits = nMints / 4 + ((nMints % 4) > 0); for ( k = nDigits - 1; k >= 0; k-- ) { Digit = ((pTruth[k/8] >> (k * 4)) & 15); @@ -569,7 +569,7 @@ void Extra_PrintHexReverse( FILE * pFile, unsigned * pTruth, int nVars ) // write the number into the file fprintf( pFile, "0x" ); nMints = (1 << nVars); - nDigits = nMints / 4; + nDigits = nMints / 4 + ((nMints % 4) > 0); for ( k = 0; k < nDigits; k++ ) { Digit = ((pTruth[k/8] >> (k * 4)) & 15); -- cgit v1.2.3