aboutsummaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2004-07-17 21:56:09 +0000
committerdrh <drh@noemail.net>2004-07-17 21:56:09 +0000
commite29b1a05a7e86fdd5bb58cd2f4f8bbc700bb01f3 (patch)
tree39a8842f15b5a12cc67846cfdc964486bd91da45 /src/printf.c
parentdd809b087f91fd906ba701da8487254eb16a8db0 (diff)
downloadsqlite-e29b1a05a7e86fdd5bb58cd2f4f8bbc700bb01f3.tar.gz
sqlite-e29b1a05a7e86fdd5bb58cd2f4f8bbc700bb01f3.zip
mprintf() correctly handles "%s","". Fix for ticket #812. (CVS 1800)
FossilOrigin-Name: 4f56db1149f65dc2edf6626fa20ae255a5f5280c
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/printf.c b/src/printf.c
index a190a1017..2ed674a88 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -228,6 +228,7 @@ static int vxprintf(
int nsd; /* Number of significant digits returned */
#endif
+ func(arg,"",0);
count = length = 0;
bufpt = 0;
for(; (c=(*fmt))!=0; ++fmt){
@@ -684,9 +685,11 @@ static void mout(void *arg, const char *zNewText, int nNewChar){
}
}
}
- if( pM->zText && nNewChar>0 ){
- memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
- pM->nChar += nNewChar;
+ if( pM->zText ){
+ if( nNewChar>0 ){
+ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
+ pM->nChar += nNewChar;
+ }
pM->zText[pM->nChar] = 0;
}
}