commit | 5a7e5083e60b6ce2037edf8e2b90632fb2ebddab | [log] [tgz] |
---|---|---|
author | Bart Van Assche <bvanassche@google.com> | Thu Feb 24 21:40:15 2022 +0000 |
committer | Bart Van Assche <bvanassche@google.com> | Thu Mar 03 18:46:12 2022 +0000 |
tree | bc8a818533a6d9d1cad941046c16d5f22d151810 | |
parent | 024e18f06032583c3e9ba36a376a444ef745080c [diff] |
healthd: Fix readFromFile() Not all readFromFile() callers pass an empty string. Make sure that readFromFile() returns 0 (failure) if the *buf argument is not empty and if reading fails. Fixes: 3217c5c7d961 ("batterymonitor: simplify readFromFile and use std::string buffers") Test: Compile-tested only. Change-Id: I6f329491f8aa4a6d378eb7c3cbc17038eb6aa64d Signed-off-by: Bart Van Assche <bvanassche@google.com>