1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Add assert to verify the number of characters to write in sqlite3_win32_write_debug.

FossilOrigin-Name: 8083f6164f3308c1c1d4f4d84be1894e382fe2e6
This commit is contained in:
mistachkin
2012-03-13 03:38:22 +00:00
parent f4f327ce07
commit 5ff72401c9
3 changed files with 8 additions and 7 deletions

View File

@@ -872,6 +872,7 @@ void sqlite3_win32_write_debug(char *zBuf, int nBuf){
char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
int nMin = MIN(nBuf,SQLITE_WIN32_DBG_BUF_SIZE-1); /* may be negative. */
if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
#if defined(SQLITE_WIN32_HAS_ANSI)
if( nMin>0 ){
memset(zDbgBuf, 0, SQLITE_WIN32_DBG_BUF_SIZE);