8000 Merge pull request #5907 from MicrosoftDocs/main · MicrosoftDocs/cpp-docs@cce9f4f · GitHub
[go: up one dir, main page]

Skip to content

Commit cce9f4f

Browse files
authored
Merge pull request #5907 from MicrosoftDocs/main
5/12/2025 AM Publish
2 parents 05b8eef + 6a9073d commit cce9f4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ See [Behavior summary](#behavior-summary) for details.
120120

121121
## Remarks
122122

123-
Beginning with the UCRT in Visual Studio 2015 and Windows 10, **`snprintf`** is no longer identical to **`_snprintf`**. The **`snprintf`** behavior is now C99 standard conformant. The difference is that if you run out of buffer, `snprintf` null-terminates the end of the buffer and returns the number of characters that would have been required whereas `_snprintf` doesn't null-terminate the buffer and returns -1. Also, `snprintf()` includes one more character in the output because it doesn't null-terminate the buffer.
123+
Beginning with the UCRT in Visual Studio 2015 and Windows 10, **`snprintf`** is no longer identical to **`_snprintf`**. The **`snprintf`** behavior is now C99 standard conformant. The difference is that if you run out of buffer, `snprintf` null-terminates the end of the buffer and returns the number of characters that would have been required whereas `_snprintf` doesn't null-terminate the buffer and returns -1. Also, `_snprintf()` includes one more character in the output because it doesn't null-terminate the buffer.
124124

125125
- **`snprintf`** and the **`_snprintf`** family of functions format and store *`count`* or fewer characters in *`buffer`*.
126126
- **`snprintf`** always stores a terminating `NULL` character, truncating the output if necessary.

0 commit comments

Comments
 (0)
0