symisc / unqlite

An Embedded NoSQL, Transactional Database Engine
https://unqlite.symisc.net
Other
2.11k stars 164 forks source link

unqlite.c: unsigned differences compared to 0 #154

Closed b4yuan closed 1 year ago

b4yuan commented 1 year ago

In the following lines (36039, 36136, 36173 respectively), the difference of two unsigned integers is compared to 0. However, since the difference of two unsigned integers can never be less than 0, this suggests that the comparison might mask a bug.

if( SyBlobLength(&pDev->sBuffer) - pDev->nOfft > 0 ){ if( SyBlobLength(&pDev->sBuffer) - pDev->nOfft > 0 ){ if( SyBlobLength(&pDev->sBuffer) - pDev->nOfft > 0 ){