| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,8 @@ not. | |||
| 28 | 28 | The wrappers ensure that ``str[size-1]`` is always ``'\0'`` upon return. They | |
| 29 | 29 | never write more than *size* bytes (including the trailing ``'\0'``) into str. | |
| 30 | 30 | Both functions require that ``str != NULL``, ``size > 0``, ``format != NULL`` | |
| 31 | - and ``size < INT_MAX``. | ||
| 31 | + and ``size < INT_MAX``. Note that this means there is no equivalent to the C99 | ||
| 32 | + ``n = snprintf(NULL, 0, ...)`` which would determine the necessary buffer size. | ||
| 32 | 33 | ||
| 33 | 34 | The return value (*rv*) for these functions should be interpreted as follows: | |
| 34 | 35 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ | |||
| 9 | 9 | would have been written had the buffer not been too small, and to set | |
| 10 | 10 | the last byte of the buffer to \0. At least MS _vsnprintf returns a | |
| 11 | 11 | negative value instead, and fills the entire buffer with non-\0 data. | |
| 12 | + Unlike C99, our wrappers do not support passing a null buffer. | ||
| 12 | 13 | ||
| 13 | 14 | The wrappers ensure that str[size-1] is always \0 upon return. | |
| 14 | 15 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments