summaryrefslogtreecommitdiffstats
path: root/Python/mysnprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/mysnprintf.c')
-rw-r--r--Python/mysnprintf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/mysnprintf.c b/Python/mysnprintf.c
index a08e249..945a81a 100644
--- a/Python/mysnprintf.c
+++ b/Python/mysnprintf.c
@@ -81,12 +81,12 @@ PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
}
len = vsprintf(buffer, format, va);
- if (len < 0)
+ if (len < 0) {
/* ignore the error */;
-
- else if ((size_t)len >= size + _PyOS_vsnprintf_EXTRA_SPACE)
- Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf");
-
+ }
+ else if ((size_t)len >= size + _PyOS_vsnprintf_EXTRA_SPACE) {
+ _Py_FatalErrorFunc(__func__, "Buffer overflow");
+ }
else {
const size_t to_copy = (size_t)len < size ?
(size_t)len : size - 1;