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>
1 file changed