Add a warning message about PyOS_snprintf (#95993)

This commit is contained in:
Eric Wieser 2022-10-07 11:49:53 -07:00 committed by GitHub
parent d5fea01d9d
commit c7b2204996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -9,6 +9,7 @@
would have been written had the buffer not been too small, and to set
the last byte of the buffer to \0. At least MS _vsnprintf returns a
negative value instead, and fills the entire buffer with non-\0 data.
Unlike C99, our wrappers do not support passing a null buffer.
The wrappers ensure that str[size-1] is always \0 upon return.