From 8dfee2b65d1e5110ec1e5aa4efe225f2f4ad06fd Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sun, 27 Apr 2014 20:06:57 +0000 Subject: [PATCH] EgtGeneral 1.5d5 : - migliorato confronto binario tra file (si interrompe oltre 10 differenze). --- EgtGeneral.rc | Bin 11630 -> 11630 bytes FileCompare.cpp | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/EgtGeneral.rc b/EgtGeneral.rc index 93ae71eab3c85a526b1295141c1d1ff543a6b5f3..087cc7b7058b7a52b014602ae260a8670a1a8c4e 100644 GIT binary patch delta 110 zcmaDC^)70|H#SDo&8x*uGfj?D44V8&Sz_`6Zn4ex6m1wc*KxZrgC#AQktD1bH>U`@ PVVCfchDu- 0 && nBuff2 > 0) { + while ( nBuff1 > 0 && nBuff2 > 0 && nDiff < 10) { // confronto dei blocchi for ( int i = 0 ; i < nBuff1 && i < nBuff2 ; ++i) { if ( cBuff1[i] != cBuff2[i]) { nDiff ++ ; - // emetto differenze - ofOut << " F1(" << ( nBase + i) << "):" << CharToHexString( cBuff1[i]) << endl ; - ofOut << " F2(" << ( nBase + i) << "):" << CharToHexString( cBuff2[i]) << endl ; + // emetto prime 10 differenze + if ( nDiff <= 10) { + ofOut << " F1(" << ( nBase + i) << "):" << CharToHexString( cBuff1[i]) << endl ; + ofOut << " F2(" << ( nBase + i) << "):" << CharToHexString( cBuff2[i]) << endl ; + } } } @@ -213,8 +216,10 @@ BinaryFileCompare( const string& sFile1, const string& sFile2, const string& sFi // emetto riassunto differenze if ( nDiff == 0) ofOut << " Same content" << endl ; - else + else if ( nDiff <= 10) ofOut << " Found " << nDiff << " differences !!!" << endl ; + else + ofOut << " Found a lot of differences ( > 10) !!!" << endl ; // chiudo i file ofOut.close() ;