Should reset errno to 0 before calling strtoll().

bug - 3431238

Change-Id: I855847209d2e022242b8eb62985759922ab94779
This commit is contained in:
James Dong
2011-02-08 15:41:58 -08:00
parent 5ed9a80571
commit 75fb238b3f

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