1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Change sqlite3_snprintf() so that it does not write a zero-terminator if

the buffer size argument is less than 1.  Ticket #2341.  Added documentation
about the sqlite3_snprintf() function. (CVS 3935)

FossilOrigin-Name: f3ae4ac5fe0bfa2f91e76a6def86c444e51fe80b
This commit is contained in:
drh
2007-05-07 11:24:30 +00:00
parent a9808b31a8
commit 6885390791
7 changed files with 83 additions and 19 deletions

View File

@@ -837,6 +837,10 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
char *z;
va_list ap;
if( n<=0 ){
return zBuf;
}
zBuf[0] = 0;
va_start(ap,zFormat);
z = base_vprintf(0, 0, zBuf, n, zFormat, ap);
va_end(ap);