You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -105,12 +105,14 @@ See [Behavior summary](#behavior-summary) for details.
105
105
106
106
## Remarks
107
107
108
-
**`vsnprintf_s`** is identical to **`_vsnprintf_s`** and is included for conformance to the ANSI standard. **`_vnsprintf`** is retained for backward compatibility.
109
-
110
108
Each of these functions takes a pointer to an argument list, then formats and writes up to *`count`* characters of the given data to the memory pointed to by *`buffer`* and appends a terminating null.
111
109
110
+
In debug builds, the remaining `sizeOfBuffer` bytes following the terminating NULL are filled with 'xFE' as described in [`_CrtSetDebugFillThreshold`](crtsetdebugfillthreshold.md).
111
+
112
112
The versions of these functions with the **`_l`** suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
113
113
114
+
**`vsnprintf_s`** is identical to **`_vsnprintf_s`** and is included for conformance to the ANSI standard. **`_vnsprintf`** is retained for backward compatibility.
115
+
114
116
### Behavior summary
115
117
116
118
For the following table:
@@ -127,7 +129,7 @@ For the following table:
127
129
|`buffer == NULL` and `sizeOfBuffer == 0` and `count == 0`| No data is written. | 0 | N/A | No |
128
130
|`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 |
129
131
|`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`| 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 |
132
+
|`buffer != NULL` and `sizeOfBuffer != 0` and `count == 0`| The buffer is NULL terminated. | -1 | N/A | No |
131
133
|`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 |
132
134
|`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 |
133
135
|`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