summaryrefslogtreecommitdiffstats
path: root/otafault
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-08-28 23:15:07 +0200
committerTianjie Xu <xunchang@google.com>2017-08-29 06:56:33 +0200
commitc89d1e7e2a6a8a07bb336db35db88f5452d8a51d (patch)
treebb13d2572bc220a73808f455c5191e62e64c368a /otafault
parentMerge "wear_ui: Remove kMaxCols/kMaxRows/visible_text_rows/menu_headers_." (diff)
downloadandroid_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.tar
android_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.tar.gz
android_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.tar.bz2
android_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.tar.lz
android_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.tar.xz
android_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.tar.zst
android_bootable_recovery-c89d1e7e2a6a8a07bb336db35db88f5452d8a51d.zip
Diffstat (limited to 'otafault')
-rw-r--r--otafault/Android.mk3
-rw-r--r--otafault/config.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/otafault/Android.mk b/otafault/Android.mk
index 7b5aab0b8..4784d56ef 100644
--- a/otafault/Android.mk
+++ b/otafault/Android.mk
@@ -24,6 +24,7 @@ otafault_static_libs := \
liblog
LOCAL_CFLAGS := \
+ -Wall \
-Werror \
-Wthread-safety \
-Wthread-safety-negative \
@@ -46,7 +47,7 @@ LOCAL_SRC_FILES := config.cpp ota_io.cpp test.cpp
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE := otafault_test
LOCAL_STATIC_LIBRARIES := $(otafault_static_libs)
-LOCAL_CFLAGS := -Werror
+LOCAL_CFLAGS := -Wall -Werror
LOCAL_C_INCLUDES := bootable/recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
diff --git a/otafault/config.cpp b/otafault/config.cpp
index 8590833ee..b94e429c6 100644
--- a/otafault/config.cpp
+++ b/otafault/config.cpp
@@ -69,7 +69,9 @@ std::string fault_fname(const char* io_type) {
fname.resize(OTAIO_MAX_FNAME_SIZE);
ZipString zip_type_path(type_path.c_str());
ZipEntry entry;
- int status = FindEntry(archive, zip_type_path, &entry);
+ if (FindEntry(archive, zip_type_path, &entry) != 0) {
+ return {};
+ }
ExtractToMemory(archive, &entry, reinterpret_cast<uint8_t*>(&fname[0]), OTAIO_MAX_FNAME_SIZE);
return fname;
}