#166 Divide-by-zero error in HashMgr::hash

open
nobody
None
5
2010-11-22
2010-11-22
MarkR
No

When stress testing hunspell under low memory conditions I got a divide-by-zero error in HashMgr::hash(const char * word)

Fix is pretty simple: just add the following code just before the return statement:

// avoid divide by zero error in % operator if tablesize == 0
if ( tablesize == 0 )
return 0;

Thanks
MarkR

Discussion