다음을 통해 공유


PREfast Warning 302 (Windows CE 5.0)

Send Feedback

302 - Format string mismatch.
Additional Information: Character string passed as parameter <number> when wide character string is required in call to <function>.

This warning indicates that the format string specifies that a wide character string is required, but a character string is being passed. This defect can result in a crash or corruption of some form.

PREfast interprets format strings based on the implementations in the C run-time library that is included with Visual C++ .NET 2002.

Example

Defective Source

char buff[5] = "hi";
wprintf(L"%s", buff);

Corrected Source

char buff[5];
wprintf(L"%hs", buff);

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.