Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9656df5 authored by Dima Zavin's avatar Dima Zavin Committed by Android Git Automerger
Browse files

am f0ad147f: Merge "BatteryService(jni): properly handle read\'s return value" into ics-mr0

* commit 'f0ad147f':
  BatteryService(jni): properly handle read's return value
parents a0d5bece f0ad147f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -141,10 +141,10 @@ static int readFromFile(const char* path, char* buf, size_t size)
        return -1;
    }
    
    size_t count = read(fd, buf, size);
    ssize_t count = read(fd, buf, size);
    if (count > 0) {
        count = (count < size) ? count : size - 1;
        while (count > 0 && buf[count-1] == '\n') count--;
        while (count > 0 && buf[count-1] == '\n')
            count--;
        buf[count] = '\0';
    } else {
        buf[0] = '\0';