Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d3e463

Browse files
author
Erlend Egeberg Aasland
authored
closes bpo-43266: Improve array formatting. (GH-24573)
1 parent 4a6bf27 commit 2d3e463

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Doc/c-api/conversion.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose is to
2525
guarantee consistent behavior in corner cases, which the Standard C functions do
2626
not.
2727
28-
The wrappers ensure that *str*[*size*-1] is always ``'\0'`` upon return. They
28+
The wrappers ensure that ``str[size-1]`` is always ``'\0'`` upon return. They
2929
never write more than *size* bytes (including the trailing ``'\0'``) into str.
3030
Both functions require that ``str != NULL``, ``size > 0``, ``format != NULL``
3131
and ``size < INT_MAX``.
@@ -34,13 +34,13 @@ The return value (*rv*) for these functions should be interpreted as follows:
3434
3535
* When ``0 <= rv < size``, the output conversion was successful and *rv*
3636
characters were written to *str* (excluding the trailing ``'\0'`` byte at
37-
*str*[*rv*]).
37+
``str[rv]``).
3838
3939
* When ``rv >= size``, the output conversion was truncated and a buffer with
40-
``rv + 1`` bytes would have been needed to succeed. *str*[*size*-1] is ``'\0'``
40+
``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is ``'\0'``
4141
in this case.
4242
43-
* When ``rv < 0``, "something bad happened." *str*[*size*-1] is ``'\0'`` in
43+
* When ``rv < 0``, "something bad happened." ``str[size-1]`` is ``'\0'`` in
4444
this case too, but the rest of *str* is undefined. The exact cause of the error
4545
depends on the underlying platform.
4646

0 commit comments

Comments
 (0)