summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringobject.c3
-rw-r--r--Objects/unicodeobject.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 3870343..504b119 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -4198,7 +4198,8 @@ formatfloat(char *buf, size_t buflen, int flags,
always given), therefore increase the length by one.
*/
- if ((type == 'g' && buflen <= (size_t)10 + (size_t)prec) ||
+ if (((type == 'g' || type == 'G') &&
+ buflen <= (size_t)10 + (size_t)prec) ||
(type == 'f' && buflen <= (size_t)53 + (size_t)prec)) {
PyErr_SetString(PyExc_OverflowError,
"formatted float is too long (precision too large?)");
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index ad33b8e..85804f1 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -7294,7 +7294,8 @@ formatfloat(Py_UNICODE *buf,
always given), therefore increase the length by one.
*/
- if ((type == 'g' && buflen <= (size_t)10 + (size_t)prec) ||
+ if (((type == 'g' || type == 'G') &&
+ buflen <= (size_t)10 + (size_t)prec) ||
(type == 'f' && buflen <= (size_t)53 + (size_t)prec)) {
PyErr_SetString(PyExc_OverflowError,
"formatted float is too long (precision too large?)");