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

Commit cbefb805 authored by James Dong's avatar James Dong Committed by Android (Google) Code Review
Browse files

Merge "Should reset errno to 0 before calling strtoll()."

parents ccc9d14d 75fb238b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -244,6 +244,10 @@ status_t StagefrightRecorder::setOutputFileAuxiliary(int fd) {
// returns true on success, false otherwise.
static bool safe_strtoi64(const char *s, int64_t *val) {
    char *end;

    // It is lame, but according to man page, we have to set errno to 0
    // before calling strtoll().
    errno = 0;
    *val = strtoll(s, &end, 10);

    if (end == s || errno == ERANGE) {