From d38015868814c9cbc9599097a395b91fceaa19ad Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Mon, 23 Nov 2020 21:16:26 +0900 Subject: [PATCH] Use quadmath_snprintf if USE_QUADMATH is defined --- Changes | 1 + dbdimp.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index d46c78c..f9e9e2b 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Changes for Perl extension DBD-SQLite 1.67_01 to be released - Switched to XSLoader (GH#63; toddr++) + - Use quadmath_snprintf if USE_QUADMATH is defined 1.66 2020-08-30 - Switched to a production version diff --git a/dbdimp.c b/dbdimp.c index 292e994..1906670 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -404,7 +404,11 @@ sqlite_is_number(pTHX_ const char *v, int sql_type) if (!_sqlite_atoi64(v, &iv)) return 1; } if (sql_type != SQLITE_INTEGER) { - sprintf(format, (has_plus ? "+%%.%df" : "%%.%df"), precision); +#ifdef USE_QUADMATH + quadmath_snprintf(format, (has_plus ? 7 : 6), (has_plus ? "+%%.%df" : "%%.%df"), precision); +#else + sprintf(format, (has_plus ? "+%%.%dF" : "%%.%dF"), precision); +#endif if (strEQ(form(format, atof(v)), v)) return 2; } return 0;