[CStringSyntaxChecker] Reduces space around error message for strlcat.

llvm-svn: 339808
This commit is contained in:
David Carlier 2018-08-15 20:09:52 +00:00
parent 3434ade2b7
commit 6a691a0b7c
2 changed files with 2 additions and 2 deletions

View File

@ -273,7 +273,7 @@ void WalkAST::VisitCallExpr(CallExpr *CE) {
if (!LenName.empty())
os << "'" << LenName << "'";
else
os << " <size> ";
os << "<size>";
if (!DstName.empty())
os << " - strlen(" << DstName << ")";
else

View File

@ -42,7 +42,7 @@ void testStrlcat(const char *src) {
strlcpy(dest, "aaaaa", sizeof("aaaaa") - 1);
strlcat(dest, "bbbb", (sizeof("bbbb") - 1) - sizeof(dest) - 1);
strlcpy(dest, "012345678", sizeof(dest));
strlcat(dest, "910", sizeof(dest)); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value <size> - strlen(dest) - 1 or lower}}
strlcat(dest, "910", sizeof(dest)); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value <size> - strlen(dest) - 1 or lower}}
strlcpy(dest, "0123456789", sizeof(dest));
strlcat(dest, "0123456789", badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value 'badlen' - strlen(dest) - 1 or lower}}
strlcat(dest, "0123456789", badlen - strlen(dest) - 1);