diff options
| author | Wayne Lin <[email protected]> | 2021-07-12 18:17:25 +0800 |
|---|---|---|
| committer | Wayne Lin <[email protected]> | 2021-07-12 18:17:25 +0800 |
| commit | 735285360929c97d49ed51dbc41dfeec570a35b3 (patch) | |
| tree | 9c1b5303717e80442037fd43f4144ff67c86bc5c /components/libc/getline | |
| parent | 978ea520d982ede86feee1f5f08b04bddd6efd1e (diff) | |
| parent | 19f1c82bc8355879d157805748b23e6dabed701d (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
Diffstat (limited to 'components/libc/getline')
| -rw-r--r-- | components/libc/getline/posix_getline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/libc/getline/posix_getline.c b/components/libc/getline/posix_getline.c index 794ac3a07d..da80242ecc 100644 --- a/components/libc/getline/posix_getline.c +++ b/components/libc/getline/posix_getline.c @@ -11,8 +11,8 @@ #include "posix_getline.h" #include <stdlib.h> -#include <errno.h> -#include <rtlibc.h> +#include <limits.h> +#include <sys/errno.h> ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) { char *cur_pos, *new_lineptr; @@ -43,7 +43,7 @@ ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) { break; if ((*lineptr + *n - cur_pos) < 2) { - if (SSIZE_MAX / 2 < *n) { + if (LONG_MAX / 2 < *n) { #ifdef EOVERFLOW errno = EOVERFLOW; #else |
