Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fixed #268 word clip length for very long words indexed
- Loading branch information
Showing
with
2 additions
and
2 deletions.
-
+2
−2
src/sphinx.cpp
|
|
|
|
|
|
|
|
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 ); |
|
|
|
|
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 ); |