opt: headword parse modification

This commit is contained in:
Xiao Yi Fang 2024-07-23 15:16:42 +08:00
parent 1ff838c876
commit e8cb709029

View file

@ -1675,6 +1675,11 @@ static void handleIdxSynFile( string const & fileName,
for ( char const * ptr = &image.front(); ptr != &image.back(); ) {
size_t wordLen = strlen( ptr );
if ( wordLen == 0 ) {
ptr++;
continue;
}
if ( ptr + wordLen + 1 + ( isSynFile ? sizeof( uint32_t ) : sizeof( uint32_t ) * 2 ) > &image.back() ) {
GD_FDPRINTF( stderr, "Warning: sudden end of file %s\n", fileName.c_str() );
break;