Skip to content

Commit cdce1ec

Browse files
TylerMSFTTylerMSFT
authored andcommitted
table cleanup
1 parent cacb300 commit cdce1ec

4 files changed

Lines changed: 37 additions & 36 deletions

‎docs/c-runtime-library/reference/snprintf-s-snprintf-s-l-snwprintf-s-snwprintf-s-l.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,20 @@ For the following table, let `len` be the size of the formatted data. If the fun
101101

102102
| Condition | Behavior | Return value | `errno` | Invokes invalid parameter handler as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md)|
103103
|--|--|--|--|--|
104-
| Success | Writes the characters (wide characters for **`_snwprintf`**) into the buffer using the specified format string | The number of characters written, not including the terminating `NULL` | N/A | No |
105-
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops | -1 | `EILSEQ (42)` | No |
106-
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error | The number of characters written, not including the terminating `NULL` | `EILSEQ (42)` | No |
107-
| `buffer == NULL` and `sizeOfBuffer == 0` and `count == 0` | No data is written | 0 | N/A | No |
104+
| Success | Writes the characters (wide characters for **`_snwprintf`**) into the buffer using the specified format string.| The number of characters written, not including the terminating `NULL`. | N/A | No |
105+
| Encoding error during formatting. | If processing string specifier `s`, `S`, or `Z`, format specification processing stops. | -1 | `EILSEQ` (42) | No |
106+
| Encoding error during formatting. | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error. | The number of characters written, not including the terminating `NULL`. | `EILSEQ` (42) | No |
107+
| `buffer == NULL` and `sizeOfBuffer == 0` and `count == 0` | No data is written. | 0 | N/A | No |
108108
| `buffer == NULL` and `sizeOfBuffer != 0` or `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
109-
| `buffer != NULL` and `sizeOfBuffer == 0` | No data is written | -1 | `EINVAL` (22) | Yes |
110-
| `count == 0`| A `NULL` is placed at the beginning of the buffer | -1 | N/A | No |
109+
| `buffer != NULL` and `sizeOfBuffer == 0` | No data is written. | -1 | `EINVAL` (22) | Yes |
110+
| `count == 0`| A `NULL` is placed at the beginning of the buffer. | -1 | N/A | No |
111111
| `count <= 0`| Unsafe: the value is treated as unsigned, likely creating a very 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 |
112-
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended | The number of characters or wide characters written | N/A | No |
112+
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended | The number of characters or wide characters written. | N/A | No |
113113
| `count < sizeOfBuffer` and `len > count` | The first *`count`* characters are written and a terminating `NULL` is appended. Remaining data isn't written. | -1 | N/A | No |
114-
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL` | The number of characters written | N/A | No |
114+
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL`. | The number of characters written. | N/A | No |
115115
| `count >= sizeOfBuffer` and `len >= sizeOfBuffer` and `count != _TRUNCATE` | If execution continues after invalid parameter handler executes, sets `buffer[0] == NULL`. | -1 | `ERANGE` (34) | Yes |
116-
| `count == _TRUNCATE` and `len >= sizeOfBuffer` | Writes as much of the string as fits in *`buffer`* (with terminating `NULL`) | -1 | N/A | No |
117-
| `count == _TRUNCATE` and `len < sizeOfBuffer` | Writes the entire string into *`buffer`* with terminating `NULL` | Number of characters written, not including the terminating `NULL` | N/A | No |
116+
| `count == _TRUNCATE` and `len >= sizeOfBuffer` | Writes as much of the string as fits in *`buffer`* and a terminating `NULL`. | -1 | N/A | No |
117+
| `count == _TRUNCATE` and `len < sizeOfBuffer` | Writes the entire string into *`buffer`* with a terminating `NULL`. | Number of characters written, not including the terminating `NULL`. | N/A | No |
118118
| `format == NULL` | No data is written. If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
119119

120120
For information about these and other error codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../errno-doserrno-sys-errlist-and-sys-nerr.md).

‎docs/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ For more information, see [Format specification syntax: `printf` and `wprintf` f
109109

110110
## Return value
111111

112-
The number of characters that which would have been written to the buffer if `count` was ignored. The count doesn't include the trailing `NULL` character.
112+
The number of characters that which would have been written to the buffer if `count` was ignored. The count doesn't include the terminating `NULL` character.
113113

114114
Let **`len`** be the length of the formatted data string, not including the terminating `NULL`.\
115115
For all functions, if `len < count`, then **`len`** characters are stored in *`buffer`*, a null-terminator is appended, and the number of characters written, not including the terminating `NULL`, is returned.
@@ -136,16 +136,16 @@ For the following table:
136136

137137
| Condition | Behavior | Return value | `errno` | Invokes invalid parameter handler as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md)|
138138
|--|--|--|--|--|
139-
| Success | Writes the characters (wide characters for **`_snwprintf`**) into the buffer using the specified format string | The number of characters written | N/A | No |
140-
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops, a NULL is placed at the beginning of the buffer | -1 | `EILSEQ (42)` | No |
141-
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error | The number of characters written, not including the terminating `NULL` | `EILSEQ (42)` | No |
139+
| Success | Writes the characters (wide characters for **`_snwprintf`**) into the buffer using the specified format string. | The number of characters written. | N/A | No |
140+
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops, a `NULL` is placed at the beginning of the buffer. | -1 | `EILSEQ` (42) | No |
141+
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error. | The number of characters written, not including the terminating `NULL`. | `EILSEQ` (42) | No |
142142
| `buffer == NULL` and `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
143-
| `count == 0` | Calculates the number of characters required to store the output | The number of characters required to store the output, not including the trailing `NULL`. | N/A | No |
144-
| `count < 0`| Unsafe: the value is treated as unsigned, likely creating a very large value that results in overwriting the memory that follows the buffer | The number of characters written | N/A | No |
145-
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended | The number of characters or wide characters written, not including the terminating `NULL` | N/A | No |
146-
| `count < sizeOfBuffer` and `len > count` | The first *`count-1`* characters are written and a terminating `NULL` is appended. Remaining data isn't written. | The number of characters that would have been written had `count` matched the number of characters to output, not including the null-terminator | N/A | No |
147-
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL` | The number of characters written, not including the terminating `NULL` | N/A | No |
148-
| `count >= sizeOfBuffer` `len >= sizeOfBuffer` | Unsafe: the value is treated as unsigned, potentially creating a very 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 |
143+
| `count == 0` | Calculates the number of characters required to store the output. | The number of characters required to store the output, not including the terminating `NULL`. | N/A | No |
144+
| `count < 0`| Unsafe: the value is treated as unsigned, likely creating a very large value that results in overwriting the memory that follows the buffer. | The number of characters written | N/A | No |
145+
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended. | The number of characters or wide characters written, not including the terminating `NULL`. | N/A | No |
146+
| `count < sizeOfBuffer` and `len > count` | The first *`count-1`* characters are written and a terminating `NULL` is appended. Remaining data isn't written. | The number of characters that would have been written had `count` matched the number of characters to output, not including the null-terminator. | N/A | No |
147+
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL`. | The number of characters written, not including the terminating `NULL` | N/A | No |
148+
| `count >= sizeOfBuffer` and `len >= sizeOfBuffer` | Unsafe: the value is treated as unsigned, potentially creating a very 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 |
149149
| `format == NULL` | No data is written. If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
150150

151151
For information about these and other error codes, see [`errno`, `_doserrno`, `_sys_errlist`, and `_sys_nerr`](../errno-doserrno-sys-errlist-and-sys-nerr.md).

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ For the following table, let `len` be the size of the formatted data. If the fun
119119
|--|--|--|--|--|
120120
| Success | Writes the characters (wide characters for **`_vsnwprintf_s`**) into the buffer using the specified format string | The number of characters written | N/A | No |
121121
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops | -1 | `EILSEQ (42)` | No |
122-
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error | The number of characters written, not including the terminating `NULL` | `EILSEQ (42)` | No |
123-
| `buffer == NULL` and `sizeOfBuffer == 0` and `count == 0` | No data is written | 0 | n/a | No |
122+
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error | The number of characters written, not including the terminating `NULL`. | `EILSEQ (42)` | No |
123+
| `buffer == NULL` and `sizeOfBuffer == 0` and `count == 0` | No data is written. | 0 | n/a | No |
124124
| `buffer == NULL` and `sizeOfBuffer != 0` or `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value.| -1 | `EINVAL` (22) | Yes |
125-
| `buffer != NULL` and `sizeOfBuffer == 0` | No data is written | -1 | `EINVAL` (22) | Yes |
125+
| `buffer != NULL` and `sizeOfBuffer == 0` | No data is written. | -1 | `EINVAL` (22) | Yes |
126126
| `count <= 0`| If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
127-
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended | The number of characters or wide characters written | N/A | No |
127+
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended. | The number of characters or wide characters written. | N/A | No |
128128
| `count < sizeOfBuffer` and `len > count` | The first *`count`* characters are written. Remaining data is truncated. | -1 | N/A | No |
129-
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL` | The number of characters written, not including the terminating `NULL` | N/A | No |
129+
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL` | The number of characters written, not including the terminating `NULL`. | N/A | No |
130130
| `count >= sizeOfBuffer` and `len >= sizeOfBuffer` and `count != _TRUNCATE` | If execution continues after invalid parameter handler executes, sets `buffer[0] == NULL`. | -1 | `ERANGE` (34) | Yes |
131-
| `count == _TRUNCATE` and `len >= sizeOfBuffer` | Writes as much of the string as fits in *`buffer`*, including the terminating `NULL` | -1 | N/A | No |
132-
| `count == _TRUNCATE` and `len < sizeOfBuffer` | Writes the entire string into *`buffer`* with terminating `NULL` | Number of characters written | N/A | No |
131+
| `count == _TRUNCATE` and `len >= sizeOfBuffer` | Writes as much of the string as fits in *`buffer`*, including the terminating `NULL`. | -1 | N/A | No |
132+
| `count == _TRUNCATE` and `len < sizeOfBuffer` | Writes the entire string into *`buffer`* with terminating `NULL`. | Number of characters written. | N/A | No |
133133
| `format == NULL` | No data is written. If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
134134

135135
For information about these and other error codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../errno-doserrno-sys-errlist-and-sys-nerr.md).

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,18 @@ For the following table:
148148

149149
| Condition | Behavior | Return value | `errno` | Invokes invalid parameter handler as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md)|
150150
|--|--|--|--|--|
151-
| Success | Writes the characters (wide characters for **`_vsnwprintf`**) into the buffer using the specified format string | The number of characters written, not counting the terminating null character | N/A | No |
152-
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops | -1 | `EILSEQ (42)` | No |
153-
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error | The number of characters written, not including the terminating `NULL` | `EILSEQ (42)` | No |
151+
| Success | Writes the characters (wide characters for **`_vsnwprintf`**) into the buffer using the specified format string. | The number of characters written, not counting the terminating null character. | N/A | No |
152+
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops. | -1 | `EILSEQ` (42) | No |
153+
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error. | The number of characters written, not including the terminating `NULL`. | `EILSEQ` (42) | No |
154154
| `buffer == NULL` and `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value.| -1 | `EINVAL` (22) | Yes |
155-
| `count == 0` | No data is written | The number of characters that would have been written, not including the terminating `NULL`. You can use this result to allocate sufficient buffer space for the string and a terminating `NULL`, and then call the function again to fill the buffer. | n/a | No |
156-
| `count < 0`| Unsafe: the value is treated as unsigned, likely creating a very large value that results in overwriting the memory that follows the buffer | The number of characters written | N/A | No |
157-
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended | The number of characters or wide characters written, not including the terminating `NULL` | N/A | No |
158-
| `count < sizeOfBuffer` and `len > count` | The first *`count-1`* characters are written followed by a null-terminator. Remaining data is truncated. | The number of characters that would have been written had `count` matched the number of characters to output, not including the null-terminator | N/A | No |
159-
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL` | The number of characters written, not including the terminating `NULL` | N/A | No |
160-
| `count >= sizeOfBuffer` and `len > = sizeOfBuffer` | Unsafe: the value is treated as unsigned, potentially creating a very 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 |
155+
| `count == 0` | No data is written | The number of characters that would have been written, not including the terminating `NULL`. You can use this result to allocate sufficient buffer space for the string and a terminating `NULL`, and then call the function again to fill the buffer. | N/A | No |
156+
| `count < 0`| Unsafe: the value is treated as unsigned, likely creating a very large value that results in overwriting the memory that follows the buffer. | The number of characters written. | N/A | No |
157+
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended. | The number of characters or wide characters written, not including the terminating `NULL`. | N/A | No |
158+
| `count < sizeOfBuffer` and `len > count` | The first *`count-1`* characters are written followed by a null-terminator. Remaining data is truncated. | The number of characters that would have been written had `count` matched the number of characters to output, not including the null-terminator. | N/A | No |
159+
| `count >= sizeOfBuffer` and `len < sizeOfBuffer` | All of the data is written with a terminating `NULL`. | The number of characters written, not including the terminating `NULL`. | N/A | No |
160+
| `count >= sizeOfBuffer` and `len > = sizeOfBuffer` | Unsafe: the value is treated as unsigned, potentially creating a very 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 |
161161
| `format == NULL` | No data is written. If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
162+
162163
For information about these and other error codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../errno-doserrno-sys-errlist-and-sys-nerr.md).
163164

164165
### Generic-text routine mappings

0 commit comments

Comments
 (0)