Skip to content

Commit

Permalink
fixed #268 word clip length for very long words indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatolog committed May 24, 2018
1 parent 39c4eb5 commit 266b705
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sphinx.cpp
Expand Up @@ -22812,7 +22812,7 @@ CSphDictKeywords::HitblockKeyword_t * CSphDictKeywords::HitblockAddKeyword ( DWO

SphWordID_t CSphDictKeywords::HitblockGetID ( const char * sWord, int iLen, SphWordID_t uCRC )
{
if ( iLen>=MAX_KEYWORD_BYTES-4 ) // fix of very long word (zones)
if ( iLen>MAX_KEYWORD_BYTES-4 ) // fix of very long word (zones)
{
memcpy ( m_sClippedWord, sWord, MAX_KEYWORD_BYTES-4 );
memset ( m_sClippedWord+MAX_KEYWORD_BYTES-4, 0, 4 );
Expand Down Expand Up @@ -23657,7 +23657,7 @@ class CRtDictKeywords : public ISphRtDictWraper
return 0;

// fix of very long word (zones)
if ( iLen>=( SPH_MAX_WORD_LEN*3 ) )
if ( iLen>( SPH_MAX_WORD_LEN*3 ) )
{
int iClippedLen = SPH_MAX_WORD_LEN*3;
m_sWord.SetBinary ( (const char *)pWord, iClippedLen );
Expand Down

0 comments on commit 266b705

Please sign in to comment.