aboutsummaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
authordrh <>2023-03-22 16:55:35 +0000
committerdrh <>2023-03-22 16:55:35 +0000
commitad99243846e76b23ba7644ec6ff77338e11f250a (patch)
tree275278f2dd33f96bbd684e8f849f7d2e504a4dce /src/printf.c
parent5e04d26a3d6861fc2968bd05dbe6f4ec58f43821 (diff)
downloadsqlite-ad99243846e76b23ba7644ec6ff77338e11f250a.tar.gz
sqlite-ad99243846e76b23ba7644ec6ff77338e11f250a.zip
The floating-point-to-text conversion with the zero-padding option now
renders NaN as "null". FossilOrigin-Name: ad59fa17663bda54ec5d4e48ac24e04b87daa70c795d840cd8db382e2dd581b9
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/printf.c b/src/printf.c
index d59855917..65e539bef 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -586,8 +586,13 @@ void sqlite3_str_vappendf(
realvalue += rounder;
}
if( sqlite3IsNaN((double)realvalue) ){
- bufpt = "NaN";
- length = 3;
+ if( flag_zeropad ){
+ bufpt = "null";
+ length = 4;
+ }else{
+ bufpt = "NaN";
+ length = 3;
+ }
break;
}