diff options
author | drh <drh@noemail.net> | 2020-05-25 15:41:03 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-05-25 15:41:03 +0000 |
commit | b6907e299370683129fd6a7380ba052ee7b11a0e (patch) | |
tree | caf6025b337e7f3d218f103d6b07c2e66a810e1a /src/printf.c | |
parent | 0934d640456bb168a8888ae388643c5160afe501 (diff) | |
download | sqlite-b6907e299370683129fd6a7380ba052ee7b11a0e.tar.gz sqlite-b6907e299370683129fd6a7380ba052ee7b11a0e.zip |
Extra assert() statements in the printf() logic.
FossilOrigin-Name: b1b182be2ab34cec1d94c5570bc361331a34f727eb9fa4aadfabb7f1ef79f83e
Diffstat (limited to 'src/printf.c')
-rw-r--r-- | src/printf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/printf.c b/src/printf.c index 4505a5675..ae957022a 100644 --- a/src/printf.c +++ b/src/printf.c @@ -401,6 +401,8 @@ void sqlite3_str_vappendf( ** xtype The class of the conversion. ** infop Pointer to the appropriate info struct. */ + assert( width>=0 ); + assert( precision>=(-1) ); switch( xtype ){ case etPOINTER: flag_long = sizeof(char*)==sizeof(i64) ? 2 : @@ -809,7 +811,7 @@ void sqlite3_str_vappendf( } isnull = escarg==0; if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); - /* For %q, %Q, and %w, the precision is the number of byte (or + /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. ** Because of the extra quoting characters inserted, the number ** of output characters may be larger than the precision. |