summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-10-07 20:36:21 (GMT)
committerGitHub <noreply@github.com>2022-10-07 20:36:21 (GMT)
commit90f2c7992f3d3285bafa1eef6d0f8255ce8921c2 (patch)
tree8c8b71e1a104af89e783e0c5b5bd5e61d978af1a /Doc
parenta3a3701fec80599f19da0faf6547cfbe58fcad13 (diff)
downloadcpython-90f2c7992f3d3285bafa1eef6d0f8255ce8921c2.zip
cpython-90f2c7992f3d3285bafa1eef6d0f8255ce8921c2.tar.gz
cpython-90f2c7992f3d3285bafa1eef6d0f8255ce8921c2.tar.bz2
Add a warning message about PyOS_snprintf (GH-95993)
(cherry picked from commit c7b220499662f0c7a4cae51e33372f92ca7b1ee9) Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/conversion.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/c-api/conversion.rst b/Doc/c-api/conversion.rst
index 9b9c4ff..fdb321f 100644
--- a/Doc/c-api/conversion.rst
+++ b/Doc/c-api/conversion.rst
@@ -28,7 +28,8 @@ not.
The wrappers ensure that ``str[size-1]`` is always ``'\0'`` upon return. They
never write more than *size* bytes (including the trailing ``'\0'``) into str.
Both functions require that ``str != NULL``, ``size > 0``, ``format != NULL``
-and ``size < INT_MAX``.
+and ``size < INT_MAX``. Note that this means there is no equivalent to the C99
+``n = snprintf(NULL, 0, ...)`` which would determine the necessary buffer size.
The return value (*rv*) for these functions should be interpreted as follows: