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

This commit is contained in:
James Dong
2011-02-08 16:07:42 -08:00
committed by Android (Google) Code Review

View File

@@ -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) {