From 41b99392c75d3e18ef30626b5c66c563327fa7c1 Mon Sep 17 00:00:00 2001 From: giantpune Date: Mon, 12 Dec 2011 07:18:29 +0000 Subject: [PATCH] * fix aligned searching. it should find a few more matches now --- symbolizer/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/symbolizer/main.cpp b/symbolizer/main.cpp index 9a48b3c..6585a91 100644 --- a/symbolizer/main.cpp +++ b/symbolizer/main.cpp @@ -165,12 +165,12 @@ int AlignedBASearch( const QByteArray &needle, const QByteArray &haystack, qint6 qint64 hSize = haystack.size(); qint64 nSize = needle.size(); - if( start % 4 || start > hSize ) + if( start % 4 || start >= hSize ) { return -1; } qint64 end = hSize - nSize; - for( ; start < end; start += 8 ) + for( ; start < end; start += 4 ) { qint64 j; for( j = 0; j < nSize; j++ ) @@ -322,7 +322,7 @@ int PatternSearch( const QString &needle, const QString &haystack, qint64 start qint64 hSize = haystack.size(); qint64 nSize = needle.size(); - if( start % 8 || start > hSize ) + if( start % 8 || start >= hSize ) { return -1; } @@ -388,7 +388,7 @@ bool PattenMatches( const QString &needle, const QString &haystack, qint64 offse qint64 hSize = haystack.size(); qint64 nSize = needle.size(); - if( nSize > hSize || offset > hSize ) + if( nSize > hSize || offset >= hSize ) { return false; }