Revert "[CStringSyntaxChecker] Reduces space around error message for strlcat."

This reverts commit 6b43b80320722da41ca6ef7a3b57cc300fb83094.

llvm-svn: 340500
This commit is contained in:
George Karpenkov 2018-08-23 00:02:12 +00:00
parent bc3089f45f
commit b45bf3bb8b
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);