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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user