From a5e9563a0f2d7f925d1590a7c4ed1561d8a3d96e Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 21 Jul 2017 14:10:46 +0700 Subject: Handling corner cases in TT print-out. --- src/misc/extra/extraUtilFile.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/misc') diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 6b4453a5..6568c305 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -592,6 +592,10 @@ void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars ) void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars ) { int nDigits, Digit, k; + if ( nVars == 0 && !(Sign[0] & 1) ) { sprintf(pString, "0"); return; } // const0 + if ( nVars == 0 && (Sign[0] & 1) ) { sprintf(pString, "1"); return; } // const1 + if ( nVars == 1 && (Sign[0] & 1) ) { sprintf(pString, "1"); return; } // inverter + if ( nVars == 1 && !(Sign[0] & 1) ) { sprintf(pString, "2"); return; } // buffer // write the number into the file nDigits = (1 << nVars) / 4; for ( k = nDigits - 1; k >= 0; k-- ) -- cgit v1.2.3