Added dot at end of stringLiteralWrite message
This commit is contained in:
parent
2a5206a444
commit
06c20252fa
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue