1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Printing a value of 0 using %c terminates the string.

FossilOrigin-Name: 255612f0a131f2f522cbca3cc5a1edcf7e38938abca25ba421e7e38a422db9c9
This commit is contained in:
drh
2018-02-19 21:58:16 +00:00
parent 57f29b7bfb
commit a15a7c352c
3 changed files with 10 additions and 9 deletions

View File

@@ -624,15 +624,16 @@ void sqlite3VXPrintf(
case etCHARX:
if( bArgList ){
bufpt = getTextArg(pArgList);
length = 0;
length = 1;
if( bufpt ){
buf[0] = c = *(bufpt++);
length = 1;
if( (c&0xc0)==0xc0 ){
while( length<4 && (bufpt[0]&0xc0)==0x80 ){
buf[length++] = *(bufpt++);
}
}
}else{
buf[0] = 0;
}
}else{
unsigned int ch = va_arg(ap,unsigned int);