summaryrefslogtreecommitdiff
path: root/tools/bit/util.cpp
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2017-10-03 09:57:55 -0700
committerChih-Hung Hsieh <chh@google.com>2017-10-13 16:25:16 -0700
commitc7edf078f92c7ce083f8c243a79f8aecdfff4ac1 (patch)
treed7816094d61913df8ee8c17e60763ccd050c4631 /tools/bit/util.cpp
parent26817938f6966928488e92de73359c3887006642 (diff)
Use -Werror in frameworks/base
* Fix unused variable and return value warnings. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: I890e65a20848d00559ba5a4f9691be1347b456af
Diffstat (limited to 'tools/bit/util.cpp')
-rw-r--r--tools/bit/util.cpp5
1 files changed, 3 insertions, 2 deletions
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<string,FileInfo>* 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);