diff options
author | 2015-01-16 16:48:51 +0000 | |
---|---|---|
committer | 2015-01-16 16:48:51 +0000 | |
commit | aea60bee5e9bad0aab62f480f19c2fb34c068de4 (patch) | |
tree | 1e7befbc10e28796528939427d4fdbd94b60d9af /lib/libc/stdio | |
parent | More evil bootstrap code. #ifndef ALIGNBYTES #define ALIGNBYTES 3. (diff) | |
download | wireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.tar.xz wireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.zip |
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/findfp.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/open_memstream.c | 8 | ||||
-rw-r--r-- | lib/libc/stdio/open_wmemstream.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index 3e5b387bbb2..ee866fa26ce 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: findfp.c,v 1.16 2014/11/19 04:19:56 guenther Exp $ */ +/* $OpenBSD: findfp.c,v 1.17 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -#include <sys/param.h> +#include <sys/param.h> /* ALIGN */ #include <unistd.h> #include <stdio.h> #include <errno.h> diff --git a/lib/libc/stdio/open_memstream.c b/lib/libc/stdio/open_memstream.c index 46105358d33..4ab9bc51e1d 100644 --- a/lib/libc/stdio/open_memstream.c +++ b/lib/libc/stdio/open_memstream.c @@ -1,4 +1,4 @@ -/* $OpenBSD: open_memstream.c,v 1.3 2013/04/03 03:11:53 guenther Exp $ */ +/* $OpenBSD: open_memstream.c,v 1.4 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org> @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> - #include <errno.h> #include <fcntl.h> #include <limits.h> @@ -26,6 +24,8 @@ #include <string.h> #include "local.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + struct state { char *string; /* actual stream */ char **pbuf; /* point to the stream */ @@ -95,7 +95,7 @@ memstream_seek(void *v, fpos_t off, int whence) } st->pos = base + off; - *st->psize = MIN(st->pos, st->len); + *st->psize = MINIMUM(st->pos, st->len); return (st->pos); } diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c index 391a944456f..0e7fc013348 100644 --- a/lib/libc/stdio/open_wmemstream.c +++ b/lib/libc/stdio/open_wmemstream.c @@ -1,4 +1,4 @@ -/* $OpenBSD: open_wmemstream.c,v 1.4 2014/10/08 05:28:19 deraadt Exp $ */ +/* $OpenBSD: open_wmemstream.c,v 1.5 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org> @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> - #include <errno.h> #include <fcntl.h> #include <limits.h> @@ -27,6 +25,8 @@ #include <wchar.h> #include "local.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + struct state { wchar_t *string; /* actual stream */ wchar_t **pbuf; /* point to the stream */ @@ -105,7 +105,7 @@ wmemstream_seek(void *v, fpos_t off, int whence) bzero(&st->mbs, sizeof(st->mbs)); st->pos = base + off; - *st->psize = MIN(st->pos, st->len); + *st->psize = MINIMUM(st->pos, st->len); return (st->pos); } |