1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-03 16:53:36 +03:00

mprintf() correctly handles "%s","". Fix for ticket #812. (CVS 1800)

FossilOrigin-Name: 4f56db1149f65dc2edf6626fa20ae255a5f5280c
This commit is contained in:
drh
2004-07-17 21:56:09 +00:00
parent dd809b087f
commit e29b1a05a7
8 changed files with 116 additions and 103 deletions

View File

@@ -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;
}
}