-C Make\ssure\sthat\sNULL\sresults\sfrom\sOP_Column\sare\sfully\sand\scompletely\sNULL\sand\sdo\snot\shave\sthe\sMEM_Ephem\sbit\sset.\sFix\sfor\sticket\s[094d39a4c95ee4].
-D 2014-11-12T14:07:28.525
+C Fix\sthe\s%c\sformat\scharacter\sin\ssqlite3VXPrintf()\sso\sthat\sit\scorrectly\shandles\sprecisions\slarger\sthan\s70.
+D 2014-11-12T14:12:28.051
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/pcache1.c e412cb585f777c840ddce0500eddc5c6043c2bb5
F src/pragma.c 3f3e959390a10c0131676f0e307acce372777e0f
F src/prepare.c 6ef0cf2f9274982988ed6b7cab1be23147e94196
-F src/printf.c 090fac0f779c93c8a95089a125339686648835e4
+F src/printf.c d83b573624f3f6bc12b800af7fd55ce90be70659
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c a3466128b52a86c466e47ac1a19e2174f7b5cf89
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/sqlite.h.in 4a5e5158c189d2bcd45c7c4607c2c0eb6d25c153
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
-F src/sqliteInt.h f7812f74f2d0c6041ef6b91a99c5a45f775dd408
+F src/sqliteInt.h c97db3c4d20b34c050a801c93451ef18e4f22de1
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c 961d5926e5a8fda611d385ec22c226b8635cd1cb
F src/table.c 2e99ef7ef16187e17033d9398dc962ce22dab5cb
F test/pragma.test 19d0241a007bcdd77fc2606ec60fc60357e7fc8b
F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
-F test/printf2.test bed79b4c3e5da08ba88ad637c0bf62586843cfb1
+F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a
F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P d4b2d5d066891e06f2bf4337902b44b000fa9fd2
-Q +42705fd7d892c4fdfb95fbbb468c99569beece25
-R 55a6f98cd186254776492ca00fba4393
+P e1017745e183f5d7429ce787ec2feef946a24f0f
+Q +08a27440f19b7fc884464832e6105af1bf008172
+R 3a2fc5ef3a825f22ce8bbd1b4d69c828
U drh
-Z efc3d14840732f527ab6a674cff641f8
+Z 3e707181121665e3dbca925048596208
-e1017745e183f5d7429ce787ec2feef946a24f0f
\ No newline at end of file
+839a6df9f98b90fb593534a62145d9c913540bae
\ No newline at end of file
const et_info *infop; /* Pointer to the appropriate info structure */
char *zOut; /* Rendering buffer */
int nOut; /* Size of the rendering buffer */
- char *zExtra; /* Malloced memory used by some conversion */
+ char *zExtra = 0; /* Malloced memory used by some conversion */
#ifndef SQLITE_OMIT_FLOATING_POINT
int exp, e2; /* exponent of real numbers */
int nsd; /* Number of significant digits returned */
break;
}
}
- zExtra = 0;
/*
** At this point, variables are initialized as follows:
}else{
c = va_arg(ap,int);
}
- buf[0] = (char)c;
- if( precision>=0 ){
- for(idx=1; idx<precision; idx++) buf[idx] = (char)c;
- length = precision;
- }else{
- length =1;
+ if( precision>1 ){
+ width -= precision-1;
+ if( width>1 && !flag_leftjustify ){
+ sqlite3AppendChar(pAccum, width-1, ' ');
+ width = 0;
+ }
+ sqlite3AppendChar(pAccum, precision-1, c);
}
+ length = 1;
+ buf[0] = c;
bufpt = buf;
break;
case etSTRING:
** the output.
*/
width -= length;
- if( width>0 && !flag_leftjustify ) sqlite3AppendSpace(pAccum, width);
+ if( width>0 && !flag_leftjustify ) sqlite3AppendChar(pAccum, width, ' ');
sqlite3StrAccumAppend(pAccum, bufpt, length);
- if( width>0 && flag_leftjustify ) sqlite3AppendSpace(pAccum, width);
+ if( width>0 && flag_leftjustify ) sqlite3AppendChar(pAccum, width, ' ');
- if( zExtra ) sqlite3_free(zExtra);
+ if( zExtra ){
+ sqlite3_free(zExtra);
+ zExtra = 0;
+ }
}/* End for loop over the format string */
} /* End of function */
}
/*
-** Append N space characters to the given string buffer.
+** Append N copies of character c to the given string buffer.
*/
-void sqlite3AppendSpace(StrAccum *p, int N){
+void sqlite3AppendChar(StrAccum *p, int N, char c){
if( p->nChar+N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ) return;
- while( (N--)>0 ) p->zText[p->nChar++] = ' ';
+ while( (N--)>0 ) p->zText[p->nChar++] = c;
}
/*
void sqlite3StrAccumInit(StrAccum*, char*, int, int);
void sqlite3StrAccumAppend(StrAccum*,const char*,int);
void sqlite3StrAccumAppendAll(StrAccum*,const char*);
-void sqlite3AppendSpace(StrAccum*,int);
+void sqlite3AppendChar(StrAccum*,int,char);
char *sqlite3StrAccumFinish(StrAccum*);
void sqlite3StrAccumReset(StrAccum*);
void sqlite3SelectDestInit(SelectDest*,int,int);
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