Skip to content

Commit e1f66f4

Browse files
authored
Update behavior description for buffer and count conditions
The behavior is slightly different than stated.
1 parent 38e139c commit e1f66f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/c-runtime-library/reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ For the following table:
127127
| `buffer == NULL` and `sizeOfBuffer == 0` and `count == 0` | No data is written. | 0 | N/A | No |
128128
| `buffer == NULL` and either `sizeOfBuffer != 0` or `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value.| -1 | `EINVAL` (22) | Yes |
129129
| `buffer != NULL` and `sizeOfBuffer == 0` | No data is written. If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
130-
| `buffer != NULL` and `sizeOfBuffer != 0` and `count == 0` | No data is written. | -1 | N/A | No |
130+
| `buffer != NULL` and `sizeOfBuffer != 0` and `count == 0` | The buffer is NULL terminated. In DEBUG builds, the remaining `sizeOfBuffer` bytes are filled with 'xFE' as described in [`_CrtSetDebugFillThreshold`](crtsetdebugfillthreshold.md). | -1 | N/A | No |
131131
| `count == 0`| Doesn't write any data and returns the number of characters that would have been written, not including the terminating `NULL`. | The number of characters that would have been written not including the terminating `NULL`. | N/A | No |
132132
| `count < 0` | Unsafe: the value is treated as unsigned, likely creating a large value that results in overwriting the memory that follows the buffer. | The number of characters written, not including the terminating `NULL`. | N/A | No |
133133
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended. | The number of characters written. | N/A | No |

0 commit comments

Comments
 (0)