Merge pull request #11597 from mirelachirica/errno_include_macosx

Missing errno.h include
pull/11614/head
Martin Kojtal 2019-09-30 15:54:16 +02:00 committed by GitHub
commit dc64165f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#include <ctype.h>
#include <stdio.h>
#include <limits.h>
#include <errno.h>
#include "ATHandler.h"
#include "mbed_poll.h"
#include "FileHandle.h"
@ -748,8 +749,7 @@ int32_t ATHandler::read_int()
}
errno = 0;
char *endptr;
long result = std::strtol(buff, &endptr, 10);
long result = std::strtol(buff, NULL, 10);
if ((result == LONG_MIN || result == LONG_MAX) && errno == ERANGE) {
return -1; // overflow/underflow
}