mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +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:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the sqlite_*_printf() interface.
|
||||
#
|
||||
# $Id: printf.test,v 1.22 2007/03/31 15:02:50 drh Exp $
|
||||
# $Id: printf.test,v 1.23 2007/05/07 11:24:31 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -268,5 +268,14 @@ do_test printf-14.3 {
|
||||
sqlite3_mprintf_str {abc-%T-123} 0 0 {not used}
|
||||
} {abc-}
|
||||
|
||||
do_test printf-15.1 {
|
||||
sqlite3_snprintf_int 5 {12345} 0
|
||||
} {1234}
|
||||
do_test printf-15.2 {
|
||||
sqlite3_snprintf_int 5 {} 0
|
||||
} {}
|
||||
do_test printf-15.3 {
|
||||
sqlite3_snprintf_int 0 {} 0
|
||||
} {abcdefghijklmnopqrstuvwxyz}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user