summaryrefslogtreecommitdiffstats
path: root/logcat
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-04-13 09:27:57 -0700
committerMark Salyzyn <salyzyn@google.com>2015-04-13 09:27:57 -0700
commit77d7e81c1c06fe47b07c3252cb21de86dbaedcd5 (patch)
treed4c5960fe77cbe88d98f8499fed434726907178f /logcat
parentb9a41bdb079932d2ce119b4c8e6615531a6471e0 (diff)
downloadsystem_core-77d7e81c1c06fe47b07c3252cb21de86dbaedcd5.zip
system_core-77d7e81c1c06fe47b07c3252cb21de86dbaedcd5.tar.gz
system_core-77d7e81c1c06fe47b07c3252cb21de86dbaedcd5.tar.bz2
logcat: build regression
printflike checks for NULL fmt at compile time, checks for NULL at runtime are optimized out. Regression as a result of commit 5976303aa6e55a9e81eadb35d50f458052e3fa24. Change-Id: Ia4e7ee4b6cb2adf1e6609c70e79684855f76e6fc
Diffstat (limited to 'logcat')
-rw-r--r--logcat/logcat.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index 5db539f..2b19b93 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -342,12 +342,10 @@ static bool getSizeTArg(char *ptr, size_t *val, size_t min = 0,
static void logcat_panic(bool showHelp, const char *fmt, ...)
{
- if (fmt) {
- va_list args;
- va_start(args, fmt);
- vfprintf(stderr, fmt, args);
- va_end(args);
- }
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
if (showHelp) {
show_help(getprogname());