From c7edf078f92c7ce083f8c243a79f8aecdfff4ac1 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Tue, 3 Oct 2017 09:57:55 -0700 Subject: Use -Werror in frameworks/base * Fix unused variable and return value warnings. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: I890e65a20848d00559ba5a4f9691be1347b456af --- tools/bit/util.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/bit/util.cpp') diff --git a/tools/bit/util.cpp b/tools/bit/util.cpp index fc93bcb8c935..922393146b10 100644 --- a/tools/bit/util.cpp +++ b/tools/bit/util.cpp @@ -101,7 +101,6 @@ TrackedFile::HasChanged() const void get_directory_contents(const string& name, map* results) { - int err; DIR* dir = opendir(name.c_str()); if (dir == NULL) { return; @@ -241,7 +240,9 @@ read_file(const string& filename) fseek(file, 0, SEEK_SET); char* buf = (char*)malloc(size); - fread(buf, 1, size, file); + if ((size_t) size != fread(buf, 1, size, file)) { + return string(); + } string result(buf, size); -- cgit v1.2.3-59-g8ed1b