diff options
Diffstat (limited to 'libc/upstream-openbsd/lib/libc/stdio/getdelim.c')
-rw-r--r-- | libc/upstream-openbsd/lib/libc/stdio/getdelim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/upstream-openbsd/lib/libc/stdio/getdelim.c b/libc/upstream-openbsd/lib/libc/stdio/getdelim.c index d709a3d18..58ff0a1be 100644 --- a/libc/upstream-openbsd/lib/libc/stdio/getdelim.c +++ b/libc/upstream-openbsd/lib/libc/stdio/getdelim.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getdelim.c,v 1.6 2017/04/13 18:36:51 brynet Exp $ */ +/* $OpenBSD: getdelim.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */ /* $NetBSD: getdelim.c,v 1.13 2011/07/22 23:12:30 joerg Exp $ */ /* @@ -73,7 +73,7 @@ getdelim(char **__restrict buf, size_t *__restrict buflen, } /* Scan through looking for the separator */ - p = memchr(fp->_p, sep, fp->_r); + p = memchr(fp->_p, sep, (size_t)fp->_r); if (p == NULL) len = fp->_r; else @@ -103,7 +103,7 @@ getdelim(char **__restrict buf, size_t *__restrict buflen, newlen++; } - newb = recallocarray(*buf, *buflen, newlen, 1); + newb = realloc(*buf, newlen); if (newb == NULL) goto error; *buf = newb; |