On Mon, 2005-02-28 at 20:03 +0100, Bernhard DÃbler wrote: > Hello, > > vdbemem.c (2004 May 26) reads at about line 650: > > if( pMem->enc==SQLITE_UTF8 && (flags & MEM_Term) ){ > assert( strlen(pMem->z)<=pMem->n ); > assert( pMem->z[pMem->n]==0 ); > } > > First is tested if the length of the passed string is shorter or equal to > the passed number of bytes it's maximal allowed to be long. Secondly is > tested if the n-th byte of the string is a NULL-char > > I don't recognize the actual need of the second assert.
Strictly speaking, assert() is never needed. These two asserts were probably put in at different times. The second assert is the more restrictive of the two. If either were eliminated it would be the first. Note that for production builds, all assert() operators become no-ops. So leaving an extra assert in the code is harmless. -- D. Richard Hipp <[EMAIL PROTECTED]>