V638. A terminal null is present inside a string. The '\0xNN' characters were encountered. Probably meant: '\xNN'.

The analyzer has detected a potential error: there is a terminal null character inside a string.

This error usually occurs through a misprint. For example, the "\0x0A" sequence is considered by the program as a sequence of four bytes: { '\0', 'x', '0', 'A' }.

If you want to define the character code in the hexadecimal form, the 'x' character should stand right after the '\' character. If you write "\0", the program will consider it as zero (in the octal format). See also:

Consider an example of incorrect code:

const char *s = "string\0x0D\0x0A";

If you try to print this string, the control characters intended to translate the string will not be used. The output functions will stop at the line-end character '\0'. To fix this bug you should replace "\0x0D\0x0A" with "\x0D\x0A".

This is the fixed code:

const char *s = "string\x0D\x0A";

This diagnostic is classified as:

You can look at examples of errors detected by the V638 diagnostic.

Bugs Found

Checked Projects
Collected Errors
14 312
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →