1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix the %c format character in sqlite3VXPrintf() so that it correctly

handles precisions larger than 70.

FossilOrigin-Name: 08a27440f19b7fc884464832e6105af1bf008172
This commit is contained in:
drh
2014-10-29 18:20:18 +00:00
parent 22e8d833f0
commit af8f513f9d
5 changed files with 49 additions and 24 deletions

View File

@ -95,5 +95,25 @@ do_execsql_test printf2-2.3 {
SELECT printf('%s=(%d/%g/%s)',a) FROM t1 ORDER BY a;
} {-1=(0/0/) 1=(0/0/) 1.5=(0/0/) abc=(0/0/)}
# The precision of the %c conversion causes the character to repeat.
#
do_execsql_test printf2-3.1 {
SELECT printf('|%110.100c|','*');
} {{| ****************************************************************************************************|}}
do_execsql_test printf2-3.2 {
SELECT printf('|%-110.100c|','*');
} {{|**************************************************************************************************** |}}
do_execsql_test printf2-3.3 {
SELECT printf('|%9.8c|%-9.8c|','*','*');
} {{| ********|******** |}}
do_execsql_test printf2-3.4 {
SELECT printf('|%8.8c|%-8.8c|','*','*');
} {|********|********|}
do_execsql_test printf2-3.5 {
SELECT printf('|%7.8c|%-7.8c|','*','*');
} {|********|********|}
finish_test