For warnings like this:

t.c:3:9: warning: invalid conversion '%B'
printf("%B\a\n", p);
~~~~~~  ^

Don't beep the console or print the newline.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41453 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaChecking.cpp b/Sema/SemaChecking.cpp
index cc682af..d5445a1 100644
--- a/Sema/SemaChecking.cpp
+++ b/Sema/SemaChecking.cpp
@@ -365,7 +365,8 @@
                                  LastConversionIdx+1);
     
     Diag(Loc, diag::warn_printf_invalid_conversion,
-         std::string(Str+LastConversionIdx, Str+StrIdx),
+         std::string(Str+LastConversionIdx,
+                     Str+std::min(LastConversionIdx+2, StrLen)),
          Fn->getSourceRange());
     return;
   }