Added dot at end of stringLiteralWrite message

This commit is contained in:
Philipp Kloke 2015-10-18 20:55:30 +02:00
parent 2a5206a444
commit 06c20252fa
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ void CheckString::stringLiteralWriteError(const Token *tok, const Token *strValu
s = s.substr(0,13) + ".."; s = s.substr(0,13) + "..";
errmsg += " \"" + s + "\""; errmsg += " \"" + s + "\"";
} }
errmsg += " directly or indirectly is undefined behaviour"; errmsg += " directly or indirectly is undefined behaviour.";
reportError(callstack, Severity::error, "stringLiteralWrite", errmsg); reportError(callstack, Severity::error, "stringLiteralWrite", errmsg);
} }

View File

@ -76,13 +76,13 @@ private:
" char *abc = \"abc\";\n" " char *abc = \"abc\";\n"
" abc[0] = 'a';\n" " abc[0] = 'a';\n"
"}"); "}");
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (error) Modifying string literal \"abc\" directly or indirectly is undefined behaviour\n", errout.str()); ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (error) Modifying string literal \"abc\" directly or indirectly is undefined behaviour.\n", errout.str());
check("void f() {\n" check("void f() {\n"
" char *abc = \"abc\";\n" " char *abc = \"abc\";\n"
" *abc = 'a';\n" " *abc = 'a';\n"
"}"); "}");
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (error) Modifying string literal \"abc\" directly or indirectly is undefined behaviour\n", errout.str()); ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (error) Modifying string literal \"abc\" directly or indirectly is undefined behaviour.\n", errout.str());
check("void f() {\n" check("void f() {\n"
" QString abc = \"abc\";\n" " QString abc = \"abc\";\n"