aboutsummaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/printf.c b/src/printf.c
index 725caa2d5..11d5b8282 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -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);