Skip to content

Commit ea50504

Browse files
authored
Quote actual warning message
Quote the actual message, bad grammar and all, to make search happy.
1 parent 8ac9b63 commit ea50504

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/code-quality/c6276.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
22
description: "Learn more about: C6276"
33
title: C6276
4-
ms.date: 08/16/2022
4+
ms.date: 09/28/2022
55
ms.topic: reference
66
f1_keywords: ["C6276", "CHAR_TO_WCHAR_CAST", "__WARNING_CHAR_TO_WCHAR_CAST"]
77
helpviewer_keywords: ["C6276"]
88
ms.assetid: 88f288da-da81-4d32-ab0f-be9d01a2606a
99
---
1010
# Warning C6276
1111

12-
> Cast between semantically different string types. Use of an invalid string can lead to undefined behavior.
12+
> Cast between semantically different string types. Use of invalid string can lead to undefined behavior.
1313
1414
This warning indicates a potentially incorrect cast from a narrow character string (`char*`) to a wide character string (`wchar_t*`).
1515

1616
## Remarks
1717

1818
Because the Microsoft compiler implements wide strings with a character size of 2 bytes, casting from a narrow string might produce strings that aren't correctly terminated. If you use such strings with the `wcs*` functions in the runtime library, they could cause buffer overruns and access violations.
1919

20-
Code analysis name: CHAR_TO_WCHAR_CAST
20+
Code analysis name: CHAR_TO_WCHAR_CAST
2121

2222
## Example
2323

24-
The following code generates this warning. It's caused by an improper cast of the narrow string `a` (2 bytes, one for the 'a' and one for the null terminator) to a wide string (a 2-byte wide character 'a' with no null terminator):
24+
The following code generates warning C6276. It's caused by an improper cast of the narrow string "a" (2 bytes, one for the 'a' and one for the null terminator) to a wide string (a 2-byte wide character 'a' with no null terminator):
2525

2626
```cpp
2727
#include <windows.h>

0 commit comments

Comments
 (0)