]> granicus.if.org Git - clang/commitdiff
Revert "[CStringSyntaxChecker] Reduces space around error message for strlcat."
authorGeorge Karpenkov <ekarpenkov@apple.com>
Thu, 23 Aug 2018 00:02:12 +0000 (00:02 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Thu, 23 Aug 2018 00:02:12 +0000 (00:02 +0000)
This reverts commit 6b43b80320722da41ca6ef7a3b57cc300fb83094.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340500 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp
test/Analysis/cstring-syntax.c

index cef48c551d8b144ef9e7888df1f9cf53100149b6..2763408facea7fe122efb578d4bf53ee2c5df033 100644 (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
index 26e3616017db606805a5e65cb6049cf36d556f10..c6d36940605626343ade5947a3eac56f629ad2e1 100644 (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);