From aea60bee5e9bad0aab62f480f19c2fb34c068de4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 16 Jan 2015 16:48:51 +0000 Subject: [PATCH] Move to the universe. review by millert, binary checking process with doug, concept with guenther --- lib/libc/asr/asr.c | 3 ++- lib/libc/asr/gethostnamadr.c | 3 ++- lib/libc/asr/gethostnamadr_async.c | 4 ++-- lib/libc/asr/getnetnamadr.c | 3 ++- lib/libc/citrus/citrus_utf8.c | 7 ++++--- lib/libc/compat-43/sigcompat.c | 1 - lib/libc/crypt/arc4random.c | 3 +-- lib/libc/crypt/crypt.c | 3 +-- lib/libc/db/btree/bt_close.c | 4 +--- lib/libc/db/btree/bt_conv.c | 4 +--- lib/libc/db/btree/bt_debug.c | 4 +--- lib/libc/db/btree/bt_overflow.c | 10 +++++----- lib/libc/db/btree/bt_utils.c | 10 +++++----- lib/libc/db/hash/hash.c | 9 +++++---- lib/libc/db/hash/hash_bigkey.c | 12 ++++++------ lib/libc/db/hash/hash_buf.c | 8 ++++---- lib/libc/db/mpool/mpool.c | 3 +-- lib/libc/db/recno/rec_utils.c | 4 +--- lib/libc/gen/clock.c | 3 +-- lib/libc/gen/disklabel.c | 3 ++- lib/libc/gen/elf_hash.c | 3 +-- lib/libc/gen/fts.c | 8 +++++--- lib/libc/gen/getgrent.c | 4 ++-- lib/libc/gen/getloadavg.c | 7 ++++--- lib/libc/gen/getmntinfo.c | 4 ++-- lib/libc/gen/getpwent.c | 10 ++++++---- lib/libc/gen/initgroups.c | 9 ++++----- lib/libc/gen/nlist.c | 8 +++++--- lib/libc/gen/popen.c | 3 +-- lib/libc/gen/scandir.c | 8 +++++--- lib/libc/gen/setdomainname.c | 4 ++-- lib/libc/gen/sethostname.c | 4 ++-- lib/libc/gen/setproctitle.c | 3 +-- lib/libc/gen/statvfs.c | 4 ++-- lib/libc/gen/sysconf.c | 6 +++--- lib/libc/gen/sysctl.c | 4 ++-- lib/libc/gen/times.c | 3 +-- lib/libc/gen/uname.c | 4 ++-- lib/libc/gmon/gmon.c | 3 +-- lib/libc/gmon/mcount.c | 4 ++-- lib/libc/hash/helper.c | 8 +++++--- lib/libc/hash/sha1.c | 4 ++-- lib/libc/hash/siphash.c | 4 ++-- lib/libc/net/base64.c | 3 +-- lib/libc/net/ethers.c | 8 ++++---- lib/libc/net/getifaddrs.c | 4 ++-- lib/libc/net/getnetent.c | 12 ++++++------ lib/libc/net/herror.c | 3 +-- lib/libc/net/inet_addr.c | 3 +-- lib/libc/net/inet_lnaof.c | 3 +-- lib/libc/net/inet_makeaddr.c | 3 +-- lib/libc/net/inet_netof.c | 3 +-- lib/libc/net/inet_ntop.c | 3 +-- lib/libc/net/inet_pton.c | 3 +-- lib/libc/net/ip6opt.c | 3 +-- lib/libc/net/rcmd.c | 4 ++-- lib/libc/net/res_comp.c | 8 ++++---- lib/libc/net/res_data.c | 3 +-- lib/libc/net/rresvport.c | 3 +-- lib/libc/net/rthdr.c | 3 +-- lib/libc/net/ruserok.c | 4 ++-- lib/libc/nls/catopen.c | 3 +-- lib/libc/rpc/clnt_simple.c | 8 ++++---- lib/libc/rpc/rpc_callmsg.c | 3 +-- lib/libc/rpc/rpc_prot.c | 4 +--- lib/libc/rpc/xdr_float.c | 3 +-- lib/libc/stdio/findfp.c | 4 ++-- lib/libc/stdio/open_memstream.c | 8 ++++---- lib/libc/stdio/open_wmemstream.c | 8 ++++---- lib/libc/stdlib/malloc.c | 4 ++-- lib/libc/stdlib/random.c | 5 +---- lib/libc/stdlib/realpath.c | 6 +++--- lib/libc/sys/stack_protector.c | 3 +-- lib/libc/yp/_yp_check.c | 4 ++-- lib/libc/yp/xdr_domainname.c | 3 +-- lib/libc/yp/xdr_keydat.c | 3 +-- lib/libc/yp/xdr_mapname.c | 3 +-- lib/libc/yp/xdr_peername.c | 3 +-- lib/libc/yp/xdr_valdat.c | 3 +-- lib/libc/yp/xdr_ypbind_binding.c | 3 +-- lib/libc/yp/xdr_ypbind_resp.c | 3 +-- lib/libc/yp/xdr_ypbind_resptype.c | 3 +-- lib/libc/yp/xdr_ypbind_setdom.c | 3 +-- lib/libc/yp/xdr_ypmaplist.c | 3 +-- lib/libc/yp/xdr_ypreq_key.c | 3 +-- lib/libc/yp/xdr_ypreq_nokey.c | 3 +-- lib/libc/yp/xdr_ypresp_all.c | 3 +-- lib/libc/yp/xdr_ypresp_key_val.c | 3 +-- lib/libc/yp/xdr_ypresp_maplist.c | 3 +-- lib/libc/yp/xdr_ypresp_master.c | 3 +-- lib/libc/yp/xdr_ypresp_order.c | 3 +-- lib/libc/yp/xdr_ypresp_val.c | 3 +-- lib/libc/yp/xdr_ypstat.c | 3 +-- lib/libc/yp/yp_all.c | 4 ++-- lib/libc/yp/yp_bind.c | 4 ++-- lib/libc/yp/yp_first.c | 4 ++-- lib/libc/yp/yp_get_default_domain.c | 4 ++-- lib/libc/yp/yp_maplist.c | 4 ++-- lib/libc/yp/yp_master.c | 4 ++-- lib/libc/yp/yp_order.c | 4 ++-- lib/libc/yp/yperr_string.c | 3 +-- lib/libc/yp/ypmatch_cache.c | 4 ++-- lib/libc/yp/ypprot_err.c | 3 +-- lib/libedit/el.c | 6 +++--- lib/libfuse/fuse_private.h | 4 ++-- lib/libkvm/kvm.c | 8 ++++---- lib/libkvm/kvm_amd64.c | 4 ++-- lib/libkvm/kvm_file2.c | 3 ++- lib/libocurses/termcap.c | 6 +++--- lib/libpcap/gencode.c | 3 ++- lib/libpcap/inet.c | 3 +-- lib/librpcsvc/bootparam_prot.x | 4 ++-- lib/librthread/rthread_np.c | 3 +-- lib/librthread/rthread_sem.c | 4 ++-- lib/librthread/rthread_stack.c | 3 +-- lib/libskey/skeylogin.c | 4 ++-- lib/libsndio/mio.c | 3 +-- lib/libsndio/mio_priv.h | 3 +-- lib/libsndio/sio.c | 3 +-- lib/libsndio/sio_priv.h | 3 +-- lib/libutil/readlabel.c | 7 ++++--- 121 files changed, 240 insertions(+), 288 deletions(-) diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c index 0498d26d3a4..65ad511c975 100644 --- a/lib/libc/asr/asr.c +++ b/lib/libc/asr/asr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asr.c,v 1.34 2014/09/15 06:15:48 guenther Exp $ */ +/* $OpenBSD: asr.c,v 1.35 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2010-2012 Eric Faurot * @@ -33,6 +33,7 @@ #include #include #include +#include #include "asr_private.h" diff --git a/lib/libc/asr/gethostnamadr.c b/lib/libc/asr/gethostnamadr.c index e07abadb443..a0aba01d3de 100644 --- a/lib/libc/asr/gethostnamadr.c +++ b/lib/libc/asr/gethostnamadr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gethostnamadr.c,v 1.11 2014/03/26 18:13:15 eric Exp $ */ +/* $OpenBSD: gethostnamadr.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2012,2013 Eric Faurot * @@ -15,6 +15,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include /* ALIGN */ #include #include #include diff --git a/lib/libc/asr/gethostnamadr_async.c b/lib/libc/asr/gethostnamadr_async.c index c2870f91db5..83acf61120f 100644 --- a/lib/libc/asr/gethostnamadr_async.c +++ b/lib/libc/asr/gethostnamadr_async.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gethostnamadr_async.c,v 1.33 2015/01/14 23:36:15 deraadt Exp $ */ +/* $OpenBSD: gethostnamadr_async.c,v 1.34 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -656,7 +656,7 @@ _yp_gethostnamadr(int type, const void *data) static char *domain = NULL; struct hostent_ext *h = NULL; const char *name; - char buf[MAXHOSTNAMELEN]; + char buf[HOST_NAME_MAX+1]; char *res = NULL; int r, len; diff --git a/lib/libc/asr/getnetnamadr.c b/lib/libc/asr/getnetnamadr.c index f3b552ab059..141b4a9ab8f 100644 --- a/lib/libc/asr/getnetnamadr.c +++ b/lib/libc/asr/getnetnamadr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnetnamadr.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */ +/* $OpenBSD: getnetnamadr.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -15,6 +15,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include /* ALIGN */ #include #include #include diff --git a/lib/libc/citrus/citrus_utf8.c b/lib/libc/citrus/citrus_utf8.c index df0f19c88c6..72abf0ce5b9 100644 --- a/lib/libc/citrus/citrus_utf8.c +++ b/lib/libc/citrus/citrus_utf8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: citrus_utf8.c,v 1.7 2014/05/03 14:10:20 stsp Exp $ */ +/* $OpenBSD: citrus_utf8.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 2002-2004 Tim J. Robbins @@ -27,7 +27,6 @@ */ #include -#include #include #include @@ -41,6 +40,8 @@ #include "citrus_ctype.h" #include "citrus_utf8.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + _CITRUS_CTYPE_DEF_OPS(utf8); struct _utf8_state { @@ -135,7 +136,7 @@ _citrus_utf8_ctype_mbrtowc(wchar_t * __restrict pwc, wch = (unsigned char)*s++ & mask; else wch = us->ch; - for (i = (us->want == 0) ? 1 : 0; i < MIN(want, n); i++) { + for (i = (us->want == 0) ? 1 : 0; i < MINIMUM(want, n); i++) { if ((*s & 0xc0) != 0x80) { /* * Malformed input; bad characters in the middle diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c index aa31ca294a2..2698dcadd87 100644 --- a/lib/libc/compat-43/sigcompat.c +++ b/lib/libc/compat-43/sigcompat.c @@ -27,7 +27,6 @@ * SUCH DAMAGE. */ -#include #include int diff --git a/lib/libc/crypt/arc4random.c b/lib/libc/crypt/arc4random.c index 1106f067076..75cdff3bc4b 100644 --- a/lib/libc/crypt/arc4random.c +++ b/lib/libc/crypt/arc4random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.51 2015/01/15 06:57:18 deraadt Exp $ */ +/* $OpenBSD: arc4random.c,v 1.52 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -31,7 +31,6 @@ #include #include #include -#include #include #define KEYSTREAM_ONLY diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c index c7ff5d970b3..7d21d4fbc37 100644 --- a/lib/libc/crypt/crypt.c +++ b/lib/libc/crypt/crypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypt.c,v 1.25 2014/12/08 20:36:18 tedu Exp $ */ +/* $OpenBSD: crypt.c,v 1.26 2015/01/16 16:48:51 deraadt Exp $ */ /* * FreeSec: libcrypt @@ -47,7 +47,6 @@ */ #include -#include #include #include #include diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c index 688c03f06e9..31cbec35fc8 100644 --- a/lib/libc/db/btree/bt_close.c +++ b/lib/libc/db/btree/bt_close.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_close.c,v 1.9 2005/08/05 13:02:59 espie Exp $ */ +/* $OpenBSD: bt_close.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,8 +32,6 @@ * SUCH DAMAGE. */ -#include - #include #include #include diff --git a/lib/libc/db/btree/bt_conv.c b/lib/libc/db/btree/bt_conv.c index a15b1daccab..03f5c9c8d4b 100644 --- a/lib/libc/db/btree/bt_conv.c +++ b/lib/libc/db/btree/bt_conv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_conv.c,v 1.9 2005/08/05 13:02:59 espie Exp $ */ +/* $OpenBSD: bt_conv.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,8 +32,6 @@ * SUCH DAMAGE. */ -#include - #include #include diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c index e3d740aa7e4..386fdb112bc 100644 --- a/lib/libc/db/btree/bt_debug.c +++ b/lib/libc/db/btree/bt_debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_debug.c,v 1.9 2005/08/08 08:05:33 espie Exp $ */ +/* $OpenBSD: bt_debug.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,8 +32,6 @@ * SUCH DAMAGE. */ -#include - #include #include #include diff --git a/lib/libc/db/btree/bt_overflow.c b/lib/libc/db/btree/bt_overflow.c index c9c411f97cf..2a92b075854 100644 --- a/lib/libc/db/btree/bt_overflow.c +++ b/lib/libc/db/btree/bt_overflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_overflow.c,v 1.10 2007/08/08 23:57:19 ray Exp $ */ +/* $OpenBSD: bt_overflow.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,8 +32,6 @@ * SUCH DAMAGE. */ -#include - #include #include #include @@ -41,6 +39,8 @@ #include #include "btree.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* * Big key/data code. * @@ -105,7 +105,7 @@ __ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz) if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) return (RET_ERROR); - nb = MIN(sz, plen); + nb = MINIMUM(sz, plen); memmove(p, (char *)h + BTDATAOFF, nb); mpool_put(t->bt_mp, h, 0); @@ -150,7 +150,7 @@ __ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg) h->flags = P_OVERFLOW; h->lower = h->upper = 0; - nb = MIN(sz, plen); + nb = MINIMUM(sz, plen); memmove((char *)h + BTDATAOFF, p, nb); if (last) { diff --git a/lib/libc/db/btree/bt_utils.c b/lib/libc/db/btree/bt_utils.c index 19a63db3441..f442ff0ba4e 100644 --- a/lib/libc/db/btree/bt_utils.c +++ b/lib/libc/db/btree/bt_utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_utils.c,v 1.10 2007/08/08 23:57:19 ray Exp $ */ +/* $OpenBSD: bt_utils.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,8 +32,6 @@ * SUCH DAMAGE. */ -#include - #include #include #include @@ -41,6 +39,8 @@ #include #include "btree.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* * __bt_ret -- * Build return key/data pair. @@ -208,7 +208,7 @@ __bt_defcmp(const DBT *a, const DBT *b) * What we need is a integral type which is guaranteed to be * larger than a size_t, and there is no such thing. */ - len = MIN(a->size, b->size); + len = MINIMUM(a->size, b->size); for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2) if (*p1 != *p2) return ((int)*p1 - (int)*p2); @@ -233,7 +233,7 @@ __bt_defpfx(a, b) size_t cnt, len; cnt = 1; - len = MIN(a->size, b->size); + len = MINIMUM(a->size, b->size); for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2, ++cnt) if (*p1 != *p2) return (cnt); diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 389afb5f8a3..42d7ee99e47 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash.c,v 1.25 2014/08/15 03:51:40 guenther Exp $ */ +/* $OpenBSD: hash.c,v 1.26 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,7 +32,6 @@ * SUCH DAMAGE. */ -#include #include #include @@ -50,6 +49,8 @@ #include "page.h" #include "extern.h" +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + static int alloc_segs(HTAB *, int); static int flush_meta(HTAB *); static int hash_access(HTAB *, ACTION, DBT *, DBT *); @@ -338,7 +339,7 @@ init_htab(HTAB *hashp, int nelem) */ nelem = (nelem - 1) / hashp->FFACTOR + 1; - l2 = __log2(MAX(nelem, 2)); + l2 = __log2(MAXIMUM(nelem, 2)); nbuckets = 1 << l2; hashp->SPARES[l2] = l2 + 1; @@ -352,7 +353,7 @@ init_htab(HTAB *hashp, int nelem) hashp->MAX_BUCKET = hashp->LOW_MASK = nbuckets - 1; hashp->HIGH_MASK = (nbuckets << 1) - 1; - hashp->HDRPAGES = ((MAX(sizeof(HASHHDR), MINHDRSIZE) - 1) >> + hashp->HDRPAGES = ((MAXIMUM(sizeof(HASHHDR), MINHDRSIZE) - 1) >> hashp->BSHIFT) + 1; nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c index 01115b1b53a..18682cc1b28 100644 --- a/lib/libc/db/hash/hash_bigkey.c +++ b/lib/libc/db/hash/hash_bigkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash_bigkey.c,v 1.17 2006/04/03 19:56:47 deraadt Exp $ */ +/* $OpenBSD: hash_bigkey.c,v 1.18 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -50,8 +50,6 @@ * collect_data */ -#include - #include #include #include @@ -66,6 +64,8 @@ #include "page.h" #include "extern.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + static int collect_key(HTAB *, BUFHEAD *, int, DBT *, int); static int collect_data(HTAB *, BUFHEAD *, int, int); @@ -97,7 +97,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) /* First move the Key */ for (space = FREESPACE(p) - BIGOVERHEAD; key_size; space = FREESPACE(p) - BIGOVERHEAD) { - move_bytes = MIN(space, key_size); + move_bytes = MINIMUM(space, key_size); off = OFFSET(p) - move_bytes; memmove(cp + off, key_data, move_bytes); key_size -= move_bytes; @@ -115,7 +115,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) if (!key_size) { space = FREESPACE(p); if (space) { - move_bytes = MIN(space, val_size); + move_bytes = MINIMUM(space, val_size); /* * If the data would fit exactly in the * remaining space, we must overflow it to the @@ -146,7 +146,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) /* Now move the data */ for (space = FREESPACE(p) - BIGOVERHEAD; val_size; space = FREESPACE(p) - BIGOVERHEAD) { - move_bytes = MIN(space, val_size); + move_bytes = MINIMUM(space, val_size); /* * Here's the hack to make sure that if the data ends on the * same page as the key ends, FREESPACE is at least one. diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c index 9e857f540bc..9645826d8a0 100644 --- a/lib/libc/db/hash/hash_buf.c +++ b/lib/libc/db/hash/hash_buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash_buf.c,v 1.18 2008/10/01 20:22:47 millert Exp $ */ +/* $OpenBSD: hash_buf.c,v 1.19 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -48,8 +48,6 @@ * newbuf */ -#include - #include #include #include @@ -65,6 +63,8 @@ #include "page.h" #include "extern.h" +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + static BUFHEAD *newbuf(HTAB *, u_int32_t, BUFHEAD *); /* Unlink B from its place in the lru */ @@ -300,7 +300,7 @@ __buf_init(HTAB *hashp, int nbytes) bfp = &(hashp->bufhead); npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT; - npages = MAX(npages, MIN_BUFFERS); + npages = MAXIMUM(npages, MIN_BUFFERS); hashp->nbufs = npages; bfp->next = bfp; diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c index 263c93b5ebc..772ded17dce 100644 --- a/lib/libc/db/mpool/mpool.c +++ b/lib/libc/db/mpool/mpool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpool.c,v 1.19 2013/12/02 02:28:21 krw Exp $ */ +/* $OpenBSD: mpool.c,v 1.20 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/db/recno/rec_utils.c b/lib/libc/db/recno/rec_utils.c index 488531ea49f..ccdd251933c 100644 --- a/lib/libc/db/recno/rec_utils.c +++ b/lib/libc/db/recno/rec_utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rec_utils.c,v 1.8 2007/08/07 05:40:34 ray Exp $ */ +/* $OpenBSD: rec_utils.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -28,8 +28,6 @@ * SUCH DAMAGE. */ -#include - #include #include #include diff --git a/lib/libc/gen/clock.c b/lib/libc/gen/clock.c index 9279457a29a..ad29073144f 100644 --- a/lib/libc/gen/clock.c +++ b/lib/libc/gen/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.5 2005/08/08 08:05:33 espie Exp $ */ +/* $OpenBSD: clock.c,v 1.6 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c index 0b9a97ba6af..9f56ba8d215 100644 --- a/lib/libc/gen/disklabel.c +++ b/lib/libc/gen/disklabel.c @@ -27,7 +27,8 @@ * SUCH DAMAGE. */ -#include +#include /* MAXFRAG DEV_BSIZE */ +#include #define DKTYPENAMES #include #include diff --git a/lib/libc/gen/elf_hash.c b/lib/libc/gen/elf_hash.c index 5feb9c58a2e..5fdc2815457 100644 --- a/lib/libc/gen/elf_hash.c +++ b/lib/libc/gen/elf_hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf_hash.c,v 1.8 2005/08/08 08:05:33 espie Exp $ */ +/* $OpenBSD: elf_hash.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1995, 1996 Erik Theisen * All rights reserved. @@ -27,7 +27,6 @@ */ #include -#include #include #include #include diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index e5cf06f14b5..0aa86572576 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fts.c,v 1.49 2014/11/23 00:14:22 guenther Exp $ */ +/* $OpenBSD: fts.c,v 1.50 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -29,7 +29,7 @@ * SUCH DAMAGE. */ -#include +#include /* ALIGN */ #include #include @@ -41,6 +41,8 @@ #include #include +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + static FTSENT *fts_alloc(FTS *, char *, size_t); static FTSENT *fts_build(FTS *, int); static void fts_lfree(FTSENT *); @@ -95,7 +97,7 @@ fts_open(char * const *argv, int options, * Start out with 1K of path space, and enough, in any case, * to hold the user's paths. */ - if (fts_palloc(sp, MAX(fts_maxarglen(argv), PATH_MAX))) + if (fts_palloc(sp, MAXIMUM(fts_maxarglen(argv), PATH_MAX))) goto mem1; /* Allocate/initialize root's parent. */ diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 638d693404d..c9c7953606c 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrent.c,v 1.41 2014/09/15 06:15:48 guenther Exp $ */ +/* $OpenBSD: getgrent.c,v 1.42 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,10 +30,10 @@ */ #include -#include #include #include #include +#include #include #include #ifdef YP diff --git a/lib/libc/gen/getloadavg.c b/lib/libc/gen/getloadavg.c index 0b38042fec7..3ab72b09b47 100644 --- a/lib/libc/gen/getloadavg.c +++ b/lib/libc/gen/getloadavg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getloadavg.c,v 1.6 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: getloadavg.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -28,13 +28,14 @@ * SUCH DAMAGE. */ -#include #include #include #include #include +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* * getloadavg() -- Get system load averages. * @@ -54,7 +55,7 @@ getloadavg(double loadavg[], int nelem) if (sysctl(mib, 2, &loadinfo, &size, NULL, 0) < 0) return (-1); - nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t)); + nelem = MINIMUM(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t)); for (i = 0; i < nelem; i++) loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale; return (nelem); diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c index 323c4cb2db3..6e9dd857cd7 100644 --- a/lib/libc/gen/getmntinfo.c +++ b/lib/libc/gen/getmntinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getmntinfo.c,v 1.7 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: getmntinfo.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 732cf884997..45f64fdf873 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getpwent.c,v 1.52 2014/03/12 10:54:36 schwarze Exp $ */ +/* $OpenBSD: getpwent.c,v 1.53 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2008 Theo de Raadt * Copyright (c) 1988, 1993 @@ -30,7 +30,7 @@ * SUCH DAMAGE. */ -#include +#include /* ALIGN */ #include #include #include @@ -51,6 +51,8 @@ #endif #include "thread_private.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + _THREAD_PRIVATE_KEY(pw); static DB *_pw_db; /* password database */ @@ -675,9 +677,9 @@ _pwhashbyname(const char *name, char *buf, size_t buflen, struct passwd *pw, if (len > _PW_NAME_LEN) return (NULL); bf[0] = _PW_KEYBYNAME; - bcopy(name, &bf[1], MIN(len, _PW_NAME_LEN)); + bcopy(name, &bf[1], MINIMUM(len, _PW_NAME_LEN)); key.data = (u_char *)bf; - key.size = 1 + MIN(len, _PW_NAME_LEN); + key.size = 1 + MINIMUM(len, _PW_NAME_LEN); r = __hashpw(&key, buf, buflen, pw, flagsp); if (r) return (pw); diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index c7a717a1410..9d7727a9c2b 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -1,4 +1,4 @@ -/* $OpenBSD: initgroups.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: initgroups.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -28,19 +28,18 @@ * SUCH DAMAGE. */ -#include - #include #include #include +#include int initgroups(const char *uname, gid_t agroup) { - gid_t groups[NGROUPS]; + gid_t groups[NGROUPS_MAX]; int ngroups; - ngroups = NGROUPS; + ngroups = NGROUPS_MAX; (void) getgrouplist(uname, agroup, groups, &ngroups); if (setgroups(ngroups, groups) < 0) return (-1); diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 9235b6b76f2..73ac65b52e7 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.57 2014/01/19 20:48:57 deraadt Exp $ */ +/* $OpenBSD: nlist.c,v 1.58 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -29,7 +29,6 @@ */ #include -#include #include #include @@ -39,12 +38,15 @@ #include #include #include +#include #include /* pulls in nlist.h */ #ifdef _NLIST_DO_ELF #include #endif +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + int __fdnlist(int, struct nlist *); #ifdef _NLIST_DO_ELF int __elf_is_okay__(Elf_Ehdr *ehdr); @@ -200,7 +202,7 @@ __fdnlist(int fd, struct nlist *list) goto elf_done; while (symsize > 0) { - cc = MIN(symsize, sizeof(sbuf)); + cc = MINIMUM(symsize, sizeof(sbuf)); if (pread(fd, sbuf, cc, (off_t)symoff) != cc) break; symsize -= cc; diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 973291d2dc8..3b07f473982 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.19 2014/08/31 02:21:18 guenther Exp $ */ +/* $OpenBSD: popen.c,v 1.20 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -31,7 +31,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 2973613efa5..0708bffc49c 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scandir.c,v 1.17 2014/10/08 05:34:59 deraadt Exp $ */ +/* $OpenBSD: scandir.c,v 1.18 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ * struct dirent (through namelist). Returns -1 if there were any errors. */ -#include +#include #include #include #include @@ -44,6 +44,8 @@ #include #include "telldir.h" +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + /* * The DIRSIZ macro is the minimum record length which will hold the directory * entry. This requires the amount of space in struct dirent without the @@ -75,7 +77,7 @@ scandir(const char *dirname, struct dirent ***namelist, * estimate the array size by taking the size of the directory file * and dividing it by a multiple of the minimum size entry. */ - arraysz = MAX(stb.st_size / 24, 16); + arraysz = MAXIMUM(stb.st_size / 24, 16); if (arraysz > SIZE_MAX / sizeof(struct dirent *)) { errno = ENOMEM; goto fail; diff --git a/lib/libc/gen/setdomainname.c b/lib/libc/gen/setdomainname.c index 0261397fe11..6e4a1c9ec56 100644 --- a/lib/libc/gen/setdomainname.c +++ b/lib/libc/gen/setdomainname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setdomainname.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: setdomainname.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include diff --git a/lib/libc/gen/sethostname.c b/lib/libc/gen/sethostname.c index 90ee4a2ef77..571db3969ee 100644 --- a/lib/libc/gen/sethostname.c +++ b/lib/libc/gen/sethostname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sethostname.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: sethostname.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c index 259c31d3507..96a80e17482 100644 --- a/lib/libc/gen/setproctitle.c +++ b/lib/libc/gen/setproctitle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setproctitle.c,v 1.12 2011/05/30 18:48:33 martynas Exp $ */ +/* $OpenBSD: setproctitle.c,v 1.13 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1994, 1995 Christopher G. Demetriou * All rights reserved. @@ -30,7 +30,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/gen/statvfs.c b/lib/libc/gen/statvfs.c index f4f7807b3cf..a17fd6e1fe8 100644 --- a/lib/libc/gen/statvfs.c +++ b/lib/libc/gen/statvfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: statvfs.c,v 1.1 2008/03/22 19:18:42 otto Exp $ */ +/* $OpenBSD: statvfs.c,v 1.2 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include #include diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index 2c6e6a49bf1..ef67c24e0dc 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysconf.c,v 1.20 2014/07/08 17:19:21 deraadt Exp $ */ +/* $OpenBSD: sysconf.c,v 1.21 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include #include @@ -203,7 +203,7 @@ sysconf(int name) /* Unsorted */ case _SC_HOST_NAME_MAX: - return (MAXHOSTNAMELEN - 1); /* does not include \0 */ + return (HOST_NAME_MAX+1 - 1); /* does not include \0 */ case _SC_MONOTONIC_CLOCK: return (_POSIX_MONOTONIC_CLOCK); case _SC_2_PBS: diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c index b0eea554bcb..116294ef2b9 100644 --- a/lib/libc/gen/sysctl.c +++ b/lib/libc/gen/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.9 2013/06/09 13:10:17 miod Exp $ */ +/* $OpenBSD: sysctl.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include int __sysctl(const int *, u_int, void *, size_t *, void *, size_t); diff --git a/lib/libc/gen/times.c b/lib/libc/gen/times.c index 86cf53eca0b..942f459388c 100644 --- a/lib/libc/gen/times.c +++ b/lib/libc/gen/times.c @@ -1,4 +1,4 @@ -/* $OpenBSD: times.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: times.c,v 1.6 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c index 09bc682fa5c..ac40802713e 100644 --- a/lib/libc/gen/uname.c +++ b/lib/libc/gen/uname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uname.c,v 1.9 2013/04/05 12:59:54 kurt Exp $ */ +/* $OpenBSD: uname.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c index 240c53c2570..89cfdc2a14f 100644 --- a/lib/libc/gmon/gmon.c +++ b/lib/libc/gmon/gmon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gmon.c,v 1.22 2013/02/12 08:06:22 mpi Exp $ */ +/* $OpenBSD: gmon.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1983, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/gmon/mcount.c b/lib/libc/gmon/mcount.c index 942d8c1887f..f0ce70dd6ae 100644 --- a/lib/libc/gmon/mcount.c +++ b/lib/libc/gmon/mcount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mcount.c,v 1.14 2013/03/12 09:37:16 mpi Exp $ */ +/* $OpenBSD: mcount.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1983, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include /* diff --git a/lib/libc/hash/helper.c b/lib/libc/hash/helper.c index c13ce461c62..ee174176894 100644 --- a/lib/libc/hash/helper.c +++ b/lib/libc/hash/helper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: helper.c,v 1.12 2015/01/15 13:05:59 millert Exp $ */ +/* $OpenBSD: helper.c,v 1.13 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp @@ -21,7 +21,7 @@ * can buy me a beer in return. Poul-Henning Kamp */ -#include +#include #include #include @@ -33,6 +33,8 @@ #include +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* ARGSUSED */ char * HASHEnd(HASH_CTX *ctx, char *buf) @@ -79,7 +81,7 @@ HASHFileChunk(const char *filename, char *buf, off_t off, off_t len) return (NULL); } - while ((nr = read(fd, buffer, MIN(sizeof(buffer), len))) > 0) { + while ((nr = read(fd, buffer, MINIMUM(sizeof(buffer), len))) > 0) { HASHUpdate(&ctx, buffer, (size_t)nr); if (len > 0 && (len -= nr) == 0) break; diff --git a/lib/libc/hash/sha1.c b/lib/libc/hash/sha1.c index d4843450ce1..fbaab9bafe8 100644 --- a/lib/libc/hash/sha1.c +++ b/lib/libc/hash/sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1.c,v 1.24 2015/01/15 13:05:59 millert Exp $ */ +/* $OpenBSD: sha1.c,v 1.25 2015/01/16 16:48:51 deraadt Exp $ */ /* * SHA-1 in C @@ -14,7 +14,7 @@ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ -#include +#include #include #include diff --git a/lib/libc/hash/siphash.c b/lib/libc/hash/siphash.c index 81b4b81865d..dcc746a9515 100644 --- a/lib/libc/hash/siphash.c +++ b/lib/libc/hash/siphash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siphash.c,v 1.1 2014/12/08 20:37:11 tedu Exp $ */ +/* $OpenBSD: siphash.c,v 1.2 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 2013 Andre Oppermann @@ -43,7 +43,7 @@ * https://131002.net/siphash/ */ -#include +#include #include #include diff --git a/lib/libc/net/base64.c b/lib/libc/net/base64.c index 7c3d1d319f6..e90696df673 100644 --- a/lib/libc/net/base64.c +++ b/lib/libc/net/base64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: base64.c,v 1.7 2013/12/31 02:32:56 tedu Exp $ */ +/* $OpenBSD: base64.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -43,7 +43,6 @@ */ #include -#include #include #include #include diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c index 07f1da33066..a89f0c217bf 100644 --- a/lib/libc/net/ethers.c +++ b/lib/libc/net/ethers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */ +/* $OpenBSD: ethers.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller @@ -27,13 +27,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #ifdef YP #include #endif @@ -159,7 +159,7 @@ ether_hostton(const char *hostname, struct ether_addr *e) { FILE *f; char buf[BUFSIZ+1], *p; - char try[MAXHOSTNAMELEN]; + char try[HOST_NAME_MAX+1]; size_t len; #ifdef YP int hostlen = strlen(hostname); @@ -223,7 +223,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname) if (*p == '\0') goto bad; n = strcspn(p, " \t\n"); - if (n >= MAXHOSTNAMELEN) + if (n >= HOST_NAME_MAX+1) goto bad; strlcpy(hostname, p, n + 1); return (0); diff --git a/lib/libc/net/getifaddrs.c b/lib/libc/net/getifaddrs.c index da42a23783e..51dbbab8717 100644 --- a/lib/libc/net/getifaddrs.c +++ b/lib/libc/net/getifaddrs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getifaddrs.c,v 1.11 2013/03/20 14:15:56 deraadt Exp $ */ +/* $OpenBSD: getifaddrs.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1995, 1999 @@ -25,11 +25,11 @@ * BSDI getifaddrs.c,v 2.12 2000/02/23 14:51:59 dab Exp */ +#include /* ALIGN */ #include #include #include #include -#include #include #include #include diff --git a/lib/libc/net/getnetent.c b/lib/libc/net/getnetent.c index 14c39f1482f..7cda141fc0e 100644 --- a/lib/libc/net/getnetent.c +++ b/lib/libc/net/getnetent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnetent.c,v 1.14 2014/09/15 06:15:48 guenther Exp $ */ +/* $OpenBSD: getnetent.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -28,13 +28,13 @@ * SUCH DAMAGE. */ -#include #include #include #include #include #include #include +#include #define MAXALIASES 35 @@ -86,8 +86,8 @@ again: if ((cp = strchr(p, '#')) != NULL) *cp = '\0'; net.n_name = p; - if (strlen(net.n_name) >= MAXHOSTNAMELEN-1) - net.n_name[MAXHOSTNAMELEN-1] = '\0'; + if (strlen(net.n_name) >= HOST_NAME_MAX+1-1) + net.n_name[HOST_NAME_MAX+1-1] = '\0'; cp = strpbrk(p, " \t"); if (cp == NULL) goto again; @@ -108,8 +108,8 @@ again: } if (q < &net_aliases[MAXALIASES - 1]) { *q++ = cp; - if (strlen(cp) >= MAXHOSTNAMELEN-1) - cp[MAXHOSTNAMELEN-1] = '\0'; + if (strlen(cp) >= HOST_NAME_MAX+1-1) + cp[HOST_NAME_MAX+1-1] = '\0'; } cp = strpbrk(cp, " \t"); if (cp != NULL) diff --git a/lib/libc/net/herror.c b/lib/libc/net/herror.c index 7787115a9da..8dee0cc382e 100644 --- a/lib/libc/net/herror.c +++ b/lib/libc/net/herror.c @@ -1,4 +1,4 @@ -/* $OpenBSD: herror.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: herror.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * ++Copyright++ 1987, 1993 @@ -52,7 +52,6 @@ */ #include -#include #include #include #include diff --git a/lib/libc/net/inet_addr.c b/lib/libc/net/inet_addr.c index 18762ab5223..2c9aa3051b6 100644 --- a/lib/libc/net/inet_addr.c +++ b/lib/libc/net/inet_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_addr.c,v 1.10 2013/11/24 23:51:28 deraadt Exp $ */ +/* $OpenBSD: inet_addr.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /* * ++Copyright++ 1983, 1990, 1993 @@ -52,7 +52,6 @@ */ #include -#include #include #include #include diff --git a/lib/libc/net/inet_lnaof.c b/lib/libc/net/inet_lnaof.c index b1a58cd2c19..92845387d37 100644 --- a/lib/libc/net/inet_lnaof.c +++ b/lib/libc/net/inet_lnaof.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_lnaof.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: inet_lnaof.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/net/inet_makeaddr.c b/lib/libc/net/inet_makeaddr.c index 87d9325231d..88ddd2850ec 100644 --- a/lib/libc/net/inet_makeaddr.c +++ b/lib/libc/net/inet_makeaddr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_makeaddr.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: inet_makeaddr.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/net/inet_netof.c b/lib/libc/net/inet_netof.c index 2f468c3aca5..4efceede132 100644 --- a/lib/libc/net/inet_netof.c +++ b/lib/libc/net/inet_netof.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_netof.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: inet_netof.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/net/inet_ntop.c b/lib/libc/net/inet_ntop.c index f991a071bab..722761e2ed9 100644 --- a/lib/libc/net/inet_ntop.c +++ b/lib/libc/net/inet_ntop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_ntop.c,v 1.10 2014/05/17 18:16:14 tedu Exp $ */ +/* $OpenBSD: inet_ntop.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. * @@ -16,7 +16,6 @@ * SOFTWARE. */ -#include #include #include #include diff --git a/lib/libc/net/inet_pton.c b/lib/libc/net/inet_pton.c index 7e521c32867..f8e299b7b8a 100644 --- a/lib/libc/net/inet_pton.c +++ b/lib/libc/net/inet_pton.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_pton.c,v 1.8 2010/05/06 15:47:14 claudio Exp $ */ +/* $OpenBSD: inet_pton.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. * @@ -16,7 +16,6 @@ * SOFTWARE. */ -#include #include #include #include diff --git a/lib/libc/net/ip6opt.c b/lib/libc/net/ip6opt.c index d98e300cb62..71dfe558031 100644 --- a/lib/libc/net/ip6opt.c +++ b/lib/libc/net/ip6opt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6opt.c,v 1.7 2014/06/13 15:41:06 chrisz Exp $ */ +/* $OpenBSD: ip6opt.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* $KAME: ip6opt.c,v 1.18 2005/06/15 07:11:35 keiichi Exp $ */ /* @@ -30,7 +30,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 617fe440aa0..afa59dde973 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +59,7 @@ int rcmd_af(char **ahost, int porta, const char *locuser, const char *remuser, const char *cmd, int *fd2p, int af) { - static char hbuf[MAXHOSTNAMELEN]; + static char hbuf[HOST_NAME_MAX+1]; char pbuf[NI_MAXSERV]; struct addrinfo hints, *res, *r; int error; diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c index 69a6ce0abbb..37c8f23dc2b 100644 --- a/lib/libc/net/res_comp.c +++ b/lib/libc/net/res_comp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_comp.c,v 1.14 2008/04/16 22:35:23 deraadt Exp $ */ +/* $OpenBSD: res_comp.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */ /* * ++Copyright++ 1985, 1993 @@ -52,7 +52,6 @@ */ #include -#include #include #include @@ -61,6 +60,7 @@ #include #include +#include #include static int dn_find(u_char *, u_char *, u_char **, u_char **); @@ -84,8 +84,8 @@ dn_expand(const u_char *msg, const u_char *eomorig, const u_char *comp_dn, dn = exp_dn; cp = comp_dn; - if (length > MAXHOSTNAMELEN-1) - length = MAXHOSTNAMELEN-1; + if (length > HOST_NAME_MAX+1-1) + length = HOST_NAME_MAX+1-1; eom = exp_dn + length; /* * fetch next label in domain name diff --git a/lib/libc/net/res_data.c b/lib/libc/net/res_data.c index a5f6b03a7f7..6e81b584a9f 100644 --- a/lib/libc/net/res_data.c +++ b/lib/libc/net/res_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_data.c,v 1.3 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: res_data.c,v 1.4 2015/01/16 16:48:51 deraadt Exp $ */ /* * ++Copyright++ 1995 @@ -52,7 +52,6 @@ */ #include -#include #include #include #include diff --git a/lib/libc/net/rresvport.c b/lib/libc/net/rresvport.c index ccc411500b8..2ecbc0a67d6 100644 --- a/lib/libc/net/rresvport.c +++ b/lib/libc/net/rresvport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rresvport.c,v 1.9 2005/11/10 10:00:17 espie Exp $ */ +/* $OpenBSD: rresvport.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1995, 1996, 1998 Theo de Raadt. All rights reserved. * Copyright (c) 1983, 1993, 1994 @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c index 9e917f1009a..92a1f75a769 100644 --- a/lib/libc/net/rthdr.c +++ b/lib/libc/net/rthdr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthdr.c,v 1.9 2014/06/13 15:41:06 chrisz Exp $ */ +/* $OpenBSD: rthdr.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /* $KAME: rthdr.c,v 1.22 2006/02/09 08:18:58 keiichi Exp $ */ /* @@ -30,7 +30,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/libc/net/ruserok.c b/lib/libc/net/ruserok.c index 4d0adfbe4ef..fed55e031d0 100644 --- a/lib/libc/net/ruserok.c +++ b/lib/libc/net/ruserok.c @@ -204,7 +204,7 @@ __ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen, const char *auser, *ahost; int hostok, userok; char *rhost = (char *)-1; - char domain[MAXHOSTNAMELEN]; + char domain[HOST_NAME_MAX+1]; size_t buflen; getdomainname(domain, sizeof(domain)); @@ -245,7 +245,7 @@ __ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen, auser = *user ? user : luser; ahost = buf; - if (strlen(ahost) >= MAXHOSTNAMELEN) + if (strlen(ahost) >= HOST_NAME_MAX+1) continue; /* diff --git a/lib/libc/nls/catopen.c b/lib/libc/nls/catopen.c index 37f8ee20f35..cd1c70047b1 100644 --- a/lib/libc/nls/catopen.c +++ b/lib/libc/nls/catopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: catopen.c,v 1.15 2013/06/01 21:26:17 stsp Exp $ */ +/* $OpenBSD: catopen.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. * All rights reserved. @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c index 7da3edd1085..2873befc48e 100644 --- a/lib/libc/rpc/clnt_simple.c +++ b/lib/libc/rpc/clnt_simple.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clnt_simple.c,v 1.16 2014/11/11 04:51:49 guenther Exp $ */ +/* $OpenBSD: clnt_simple.c,v 1.17 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -36,13 +36,13 @@ * Simplified front end to rpc. */ -#include #include #include #include #include #include #include +#include #include static struct callrpc_private { @@ -70,7 +70,7 @@ callrpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, callrpc_private = crp; } if (crp->oldhost == NULL) { - crp->oldhost = malloc(MAXHOSTNAMELEN); + crp->oldhost = malloc(HOST_NAME_MAX+1); if (crp->oldhost == NULL) { free(crp); callrpc_private = save_callrpc_private; @@ -108,7 +108,7 @@ callrpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, crp->valid = 1; crp->oldprognum = prognum; crp->oldversnum = versnum; - strlcpy(crp->oldhost, host, MAXHOSTNAMELEN); + strlcpy(crp->oldhost, host, HOST_NAME_MAX+1); } tottimeout.tv_sec = 25; tottimeout.tv_usec = 0; diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c index fc217b24274..a6b47bb8003 100644 --- a/lib/libc/rpc/rpc_callmsg.c +++ b/lib/libc/rpc/rpc_callmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_callmsg.c,v 1.10 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: rpc_callmsg.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -33,7 +33,6 @@ #include #include -#include #include diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c index 4725384a9ea..ac2bc90a05a 100644 --- a/lib/libc/rpc/rpc_prot.c +++ b/lib/libc/rpc/rpc_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_prot.c,v 1.11 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: rpc_prot.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -42,8 +42,6 @@ * routines are also in this program. */ -#include - #include /* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */ diff --git a/lib/libc/rpc/xdr_float.c b/lib/libc/rpc/xdr_float.c index 4ff14885a35..d82e9899fb2 100644 --- a/lib/libc/rpc/xdr_float.c +++ b/lib/libc/rpc/xdr_float.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_float.c,v 1.21 2014/07/21 01:51:11 guenther Exp $ */ +/* $OpenBSD: xdr_float.c,v 1.22 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -41,7 +41,6 @@ #include #include -#include #include #include 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 +#include /* ALIGN */ #include #include #include 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 @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include #include #include @@ -26,6 +24,8 @@ #include #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 @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include #include #include @@ -27,6 +25,8 @@ #include #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); } diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 57d35b80b6e..69ae877abac 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.172 2015/01/05 21:04:04 tedu Exp $ */ +/* $OpenBSD: malloc.c,v 1.173 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2008, 2010, 2011 Otto Moerbeek * Copyright (c) 2012 Matthew Dempsky @@ -26,7 +26,7 @@ /* #define MALLOC_STATS */ #include -#include +#include /* PAGE_SHIFT ALIGN */ #include #include #include diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index 96cced9a204..e293648ecd3 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: random.c,v 1.28 2014/12/16 20:51:32 sthen Exp $ */ +/* $OpenBSD: random.c,v 1.29 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. @@ -28,9 +28,6 @@ * SUCH DAMAGE. */ -#include -#include -#include #include #include #include diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index e06db59088f..7b70b9ddfb3 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: realpath.c,v 1.18 2014/10/19 03:56:28 doug Exp $ */ +/* $OpenBSD: realpath.c,v 1.19 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2003 Constantin S. Svintsoff * @@ -27,13 +27,13 @@ * SUCH DAMAGE. */ -#include #include #include #include #include #include +#include /* A slightly modified copy of this file exists in libexec/ld.so */ @@ -156,7 +156,7 @@ realpath(const char *path, char *resolved) goto err; } if (S_ISLNK(sb.st_mode)) { - if (symlinks++ > MAXSYMLINKS) { + if (symlinks++ > SYMLOOP_MAX) { errno = ELOOP; goto err; } diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c index 5cdb06d282a..0e757841dc9 100644 --- a/lib/libc/sys/stack_protector.c +++ b/lib/libc/sys/stack_protector.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stack_protector.c,v 1.15 2013/12/28 18:42:42 deraadt Exp $ */ +/* $OpenBSD: stack_protector.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2002 Hiroaki Etoh, Federico G. Schwindt, and Miodrag Vallat. @@ -27,7 +27,6 @@ * */ -#include #include #include #include diff --git a/lib/libc/yp/_yp_check.c b/lib/libc/yp/_yp_check.c index f7576afc653..18b3a949808 100644 --- a/lib/libc/yp/_yp_check.c +++ b/lib/libc/yp/_yp_check.c @@ -1,4 +1,4 @@ -/* $OpenBSD: _yp_check.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: _yp_check.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,8 +25,8 @@ * SUCH DAMAGE. */ -#include #include +#include #include #include #include diff --git a/lib/libc/yp/xdr_domainname.c b/lib/libc/yp/xdr_domainname.c index 74838bdd18e..5dcc4d1140e 100644 --- a/lib/libc/yp/xdr_domainname.c +++ b/lib/libc/yp/xdr_domainname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_domainname.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_domainname.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_keydat.c b/lib/libc/yp/xdr_keydat.c index 21c5768b0f0..6f774afec3f 100644 --- a/lib/libc/yp/xdr_keydat.c +++ b/lib/libc/yp/xdr_keydat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_keydat.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_keydat.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_mapname.c b/lib/libc/yp/xdr_mapname.c index 68e7302530d..c2a98bac0f2 100644 --- a/lib/libc/yp/xdr_mapname.c +++ b/lib/libc/yp/xdr_mapname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_mapname.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_mapname.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_peername.c b/lib/libc/yp/xdr_peername.c index 332ce89d66a..b5e7bd1461c 100644 --- a/lib/libc/yp/xdr_peername.c +++ b/lib/libc/yp/xdr_peername.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_peername.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_peername.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_valdat.c b/lib/libc/yp/xdr_valdat.c index f3d81e193cf..1d5a2eaab69 100644 --- a/lib/libc/yp/xdr_valdat.c +++ b/lib/libc/yp/xdr_valdat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_valdat.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_valdat.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypbind_binding.c b/lib/libc/yp/xdr_ypbind_binding.c index 5d80f19f8db..6ece28bfdec 100644 --- a/lib/libc/yp/xdr_ypbind_binding.c +++ b/lib/libc/yp/xdr_ypbind_binding.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypbind_binding.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypbind_binding.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypbind_resp.c b/lib/libc/yp/xdr_ypbind_resp.c index 51821f7131c..d1493f2a0b6 100644 --- a/lib/libc/yp/xdr_ypbind_resp.c +++ b/lib/libc/yp/xdr_ypbind_resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypbind_resp.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypbind_resp.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypbind_resptype.c b/lib/libc/yp/xdr_ypbind_resptype.c index 43f996caeb3..8bf7e47d312 100644 --- a/lib/libc/yp/xdr_ypbind_resptype.c +++ b/lib/libc/yp/xdr_ypbind_resptype.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypbind_resptype.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypbind_resptype.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypbind_setdom.c b/lib/libc/yp/xdr_ypbind_setdom.c index 1f8a3dacda4..40e33cd7803 100644 --- a/lib/libc/yp/xdr_ypbind_setdom.c +++ b/lib/libc/yp/xdr_ypbind_setdom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypbind_setdom.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypbind_setdom.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypmaplist.c b/lib/libc/yp/xdr_ypmaplist.c index 998d0291851..4db0bda2e1f 100644 --- a/lib/libc/yp/xdr_ypmaplist.c +++ b/lib/libc/yp/xdr_ypmaplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypmaplist.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypmaplist.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypreq_key.c b/lib/libc/yp/xdr_ypreq_key.c index 5b3c6c25907..b4dcddece30 100644 --- a/lib/libc/yp/xdr_ypreq_key.c +++ b/lib/libc/yp/xdr_ypreq_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypreq_key.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypreq_key.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypreq_nokey.c b/lib/libc/yp/xdr_ypreq_nokey.c index 7a920592e1a..a6e4b4b528f 100644 --- a/lib/libc/yp/xdr_ypreq_nokey.c +++ b/lib/libc/yp/xdr_ypreq_nokey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypreq_nokey.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypreq_nokey.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypresp_all.c b/lib/libc/yp/xdr_ypresp_all.c index 11a1c5b220b..d25c0186c47 100644 --- a/lib/libc/yp/xdr_ypresp_all.c +++ b/lib/libc/yp/xdr_ypresp_all.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypresp_all.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypresp_all.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypresp_key_val.c b/lib/libc/yp/xdr_ypresp_key_val.c index d6567d73303..4e285be6d36 100644 --- a/lib/libc/yp/xdr_ypresp_key_val.c +++ b/lib/libc/yp/xdr_ypresp_key_val.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypresp_key_val.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypresp_key_val.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypresp_maplist.c b/lib/libc/yp/xdr_ypresp_maplist.c index edea438bf0c..434276effe0 100644 --- a/lib/libc/yp/xdr_ypresp_maplist.c +++ b/lib/libc/yp/xdr_ypresp_maplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypresp_maplist.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypresp_maplist.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypresp_master.c b/lib/libc/yp/xdr_ypresp_master.c index 77564692a19..ac4edfc3a5a 100644 --- a/lib/libc/yp/xdr_ypresp_master.c +++ b/lib/libc/yp/xdr_ypresp_master.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypresp_master.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypresp_master.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypresp_order.c b/lib/libc/yp/xdr_ypresp_order.c index 5d2d3bcf5eb..39bbc15a710 100644 --- a/lib/libc/yp/xdr_ypresp_order.c +++ b/lib/libc/yp/xdr_ypresp_order.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypresp_order.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypresp_order.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypresp_val.c b/lib/libc/yp/xdr_ypresp_val.c index 056fa8d8003..b1c81e2e467 100644 --- a/lib/libc/yp/xdr_ypresp_val.c +++ b/lib/libc/yp/xdr_ypresp_val.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypresp_val.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypresp_val.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/xdr_ypstat.c b/lib/libc/yp/xdr_ypstat.c index 5a045eba536..bb41cba7bcd 100644 --- a/lib/libc/yp/xdr_ypstat.c +++ b/lib/libc/yp/xdr_ypstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_ypstat.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: xdr_ypstat.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/yp_all.c b/lib/libc/yp/yp_all.c index 50c9d5f68b1..35398acafdc 100644 --- a/lib/libc/yp/yp_all.c +++ b/lib/libc/yp/yp_all.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_all.c,v 1.10 2010/04/02 17:35:03 schwarze Exp $ */ +/* $OpenBSD: yp_all.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,11 +25,11 @@ * SUCH DAMAGE. */ -#include #include #include #include #include +#include #include #include #include diff --git a/lib/libc/yp/yp_bind.c b/lib/libc/yp/yp_bind.c index c292686839d..73cbd3888b2 100644 --- a/lib/libc/yp/yp_bind.c +++ b/lib/libc/yp/yp_bind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_bind.c,v 1.21 2015/01/14 23:36:16 deraadt Exp $ */ +/* $OpenBSD: yp_bind.c,v 1.22 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993, 1996 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include @@ -35,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/libc/yp/yp_first.c b/lib/libc/yp/yp_first.c index 3e24f39ef95..e631cc2e81f 100644 --- a/lib/libc/yp/yp_first.c +++ b/lib/libc/yp/yp_first.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_first.c,v 1.9 2009/06/07 03:33:36 schwarze Exp $ */ +/* $OpenBSD: yp_first.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,8 +25,8 @@ * SUCH DAMAGE. */ -#include #include +#include #include #include #include diff --git a/lib/libc/yp/yp_get_default_domain.c b/lib/libc/yp/yp_get_default_domain.c index d48e3d1eddf..2d72429fbcb 100644 --- a/lib/libc/yp/yp_get_default_domain.c +++ b/lib/libc/yp/yp_get_default_domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_get_default_domain.c,v 1.7 2009/06/05 16:39:39 schwarze Exp $ */ +/* $OpenBSD: yp_get_default_domain.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,9 +25,9 @@ * SUCH DAMAGE. */ -#include #include #include +#include #include #include #include diff --git a/lib/libc/yp/yp_maplist.c b/lib/libc/yp/yp_maplist.c index b8785527c51..17bdefe103f 100644 --- a/lib/libc/yp/yp_maplist.c +++ b/lib/libc/yp/yp_maplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_maplist.c,v 1.8 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: yp_maplist.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,9 +25,9 @@ * SUCH DAMAGE. */ -#include #include #include +#include #include #include #include diff --git a/lib/libc/yp/yp_master.c b/lib/libc/yp/yp_master.c index eb1597495d9..0d8f6787ccc 100644 --- a/lib/libc/yp/yp_master.c +++ b/lib/libc/yp/yp_master.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_master.c,v 1.8 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: yp_master.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,9 +25,9 @@ * SUCH DAMAGE. */ -#include #include #include +#include #include #include #include diff --git a/lib/libc/yp/yp_order.c b/lib/libc/yp/yp_order.c index fbea4f334c8..696137ae0f4 100644 --- a/lib/libc/yp/yp_order.c +++ b/lib/libc/yp/yp_order.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_order.c,v 1.9 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: yp_order.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,9 +25,9 @@ * SUCH DAMAGE. */ -#include #include #include +#include #include #include #include diff --git a/lib/libc/yp/yperr_string.c b/lib/libc/yp/yperr_string.c index cb959f8120b..56dbc1df81c 100644 --- a/lib/libc/yp/yperr_string.c +++ b/lib/libc/yp/yperr_string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yperr_string.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: yperr_string.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libc/yp/ypmatch_cache.c b/lib/libc/yp/ypmatch_cache.c index 2f8d508c459..8d2c65c5b49 100644 --- a/lib/libc/yp/ypmatch_cache.c +++ b/lib/libc/yp/ypmatch_cache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypmatch_cache.c,v 1.15 2009/11/01 00:08:54 schwarze Exp $ */ +/* $OpenBSD: ypmatch_cache.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,10 +25,10 @@ * SUCH DAMAGE. */ -#include #include #include #include +#include #include #include #include diff --git a/lib/libc/yp/ypprot_err.c b/lib/libc/yp/ypprot_err.c index d5a7f63ca2f..618d508b502 100644 --- a/lib/libc/yp/ypprot_err.c +++ b/lib/libc/yp/ypprot_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypprot_err.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: ypprot_err.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/libedit/el.c b/lib/libedit/el.c index bdbbd80a588..8721f4944c2 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -1,4 +1,4 @@ -/* $OpenBSD: el.c,v 1.19 2014/10/17 06:07:50 deraadt Exp $ */ +/* $OpenBSD: el.c,v 1.20 2015/01/16 16:48:51 deraadt Exp $ */ /* $NetBSD: el.c,v 1.61 2011/01/27 23:11:40 christos Exp $ */ /*- @@ -39,12 +39,12 @@ * el.c: EditLine interface functions */ #include -#include #include #include #include #include #include +#include #include #include "el.h" @@ -501,7 +501,7 @@ el_source(EditLine *el, const char *fname) size_t len; char *ptr, *lptr = NULL; #ifdef HAVE_ISSETUGID - char path[MAXPATHLEN]; + char path[PATH_MAX]; #endif const Char *dptr; diff --git a/lib/libfuse/fuse_private.h b/lib/libfuse/fuse_private.h index cf6e7b6a6d5..10a0b5dc566 100644 --- a/lib/libfuse/fuse_private.h +++ b/lib/libfuse/fuse_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_private.h,v 1.10 2014/04/28 13:08:34 syl Exp $ */ +/* $OpenBSD: fuse_private.h,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2013 Sylvestre Gallon * @@ -18,12 +18,12 @@ #ifndef _FUSE_SUBR_H_ #define _FUSE_SUBR_H_ -#include #include #include #include #include #include +#include #include "fuse.h" diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 7fb4036ba82..ceeb2f6d6fa 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm.c,v 1.53 2014/08/15 03:51:40 guenther Exp $ */ +/* $OpenBSD: kvm.c,v 1.54 2015/01/16 16:48:51 deraadt Exp $ */ /* $NetBSD: kvm.c,v 1.43 1996/05/05 04:31:59 gwr Exp $ */ /*- @@ -34,7 +34,7 @@ * SUCH DAMAGE. */ -#include +#include /* MAXCOMLEN MID_MACHINE */ #include #include #include @@ -194,7 +194,7 @@ _kvm_open(kvm_t *kd, const char *uf, const char *mf, const char *sf, return (kd); } - if (uf && strlen(uf) >= MAXPATHLEN) { + if (uf && strlen(uf) >= PATH_MAX) { _kvm_err(kd, kd->program, "exec file name too long"); goto failed; } @@ -672,7 +672,7 @@ static int kvm_dbopen(kvm_t *kd, const char *uf) { char dbversion[_POSIX2_LINE_MAX], kversion[_POSIX2_LINE_MAX]; - char dbname[MAXPATHLEN]; + char dbname[PATH_MAX]; struct nlist nitem; size_t dbversionlen; DBT rec; diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c index 5e9f075c52b..1a284db0e6d 100644 --- a/lib/libkvm/kvm_amd64.c +++ b/lib/libkvm/kvm_amd64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_amd64.c,v 1.11 2013/11/01 15:57:56 deraadt Exp $ */ +/* $OpenBSD: kvm_amd64.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */ /* $NetBSD: kvm_x86_64.c,v 1.3 2002/06/05 22:01:55 fvdl Exp $ */ /*- @@ -38,7 +38,7 @@ * x86-64 machine dependent routines for kvm. */ -#include +#include /* MAXCOMLEN */ #include #include #include diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c index c89b4719d1c..35d26b5ba96 100644 --- a/lib/libkvm/kvm_file2.c +++ b/lib/libkvm/kvm_file2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_file2.c,v 1.40 2014/11/19 13:35:36 krw Exp $ */ +/* $OpenBSD: kvm_file2.c,v 1.41 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2009 Todd C. Miller @@ -110,6 +110,7 @@ #include #include #include +#include #include "kvm_private.h" #include "kvm_file.h" diff --git a/lib/libocurses/termcap.c b/lib/libocurses/termcap.c index a70706fdedc..8d3887bd884 100644 --- a/lib/libocurses/termcap.c +++ b/lib/libocurses/termcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: termcap.c,v 1.9 2005/08/14 17:15:19 espie Exp $ */ +/* $OpenBSD: termcap.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /* $NetBSD: termcap.c,v 1.7 1995/06/05 19:45:52 pk Exp $ */ /* @@ -33,12 +33,12 @@ #define PBUFSIZ 512 /* max length of filename path */ #define PVECSIZ 32 /* max number of names in path */ -#include #include #include #include #include #include +#include #include #include "pathnames.h" @@ -71,7 +71,7 @@ tgetent(bp, name) char **fname; char *home; int i; - char pathbuf[MAXPATHLEN]; /* holds raw path of filenames */ + char pathbuf[PATH_MAX]; /* holds raw path of filenames */ char *pathvec[PVECSIZ]; /* to point to names in pathbuf */ char **pvec; /* holds usable tail of path vector */ char *termpath; diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c index 47b8a2abe53..da7ef341994 100644 --- a/lib/libpcap/gencode.c +++ b/lib/libpcap/gencode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gencode.c,v 1.39 2014/11/20 14:51:41 krw Exp $ */ +/* $OpenBSD: gencode.c,v 1.40 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998 @@ -21,6 +21,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#include /* ALIGN */ #include #include #include diff --git a/lib/libpcap/inet.c b/lib/libpcap/inet.c index 48aca3d437a..05c2cf702e6 100644 --- a/lib/libpcap/inet.c +++ b/lib/libpcap/inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.c,v 1.19 2006/03/26 20:58:50 djm Exp $ */ +/* $OpenBSD: inet.c,v 1.20 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1994, 1995, 1996, 1997, 1998 @@ -34,7 +34,6 @@ */ -#include #include #include #include diff --git a/lib/librpcsvc/bootparam_prot.x b/lib/librpcsvc/bootparam_prot.x index cde4e9334fb..a8df0fc7858 100644 --- a/lib/librpcsvc/bootparam_prot.x +++ b/lib/librpcsvc/bootparam_prot.x @@ -1,4 +1,4 @@ -/* $OpenBSD: bootparam_prot.x,v 1.9 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: bootparam_prot.x,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -42,7 +42,7 @@ */ #ifdef RPC_HDR -%#include +%#include %#include %#include %#include diff --git a/lib/librthread/rthread_np.c b/lib/librthread/rthread_np.c index 9b26f567915..828aadf69ba 100644 --- a/lib/librthread/rthread_np.c +++ b/lib/librthread/rthread_np.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_np.c,v 1.15 2014/12/08 18:15:46 tedu Exp $ */ +/* $OpenBSD: rthread_np.c,v 1.16 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst * Copyright (c) 2005 Otto Moerbeek @@ -17,7 +17,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include diff --git a/lib/librthread/rthread_sem.c b/lib/librthread/rthread_sem.c index 14252a83185..ecba0d3be5e 100644 --- a/lib/librthread/rthread_sem.c +++ b/lib/librthread/rthread_sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sem.c,v 1.19 2014/06/27 23:21:47 matthew Exp $ */ +/* $OpenBSD: rthread_sem.c,v 1.20 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 2004,2005,2013 Ted Unangst * All Rights Reserved. @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include + #include #include #include diff --git a/lib/librthread/rthread_stack.c b/lib/librthread/rthread_stack.c index f73178ff35f..19ea890b154 100644 --- a/lib/librthread/rthread_stack.c +++ b/lib/librthread/rthread_stack.c @@ -1,9 +1,8 @@ -/* $OpenBSD: rthread_stack.c,v 1.12 2014/06/27 23:21:47 matthew Exp $ */ +/* $OpenBSD: rthread_stack.c,v 1.13 2015/01/16 16:48:52 deraadt Exp $ */ /* $snafu: rthread_stack.c,v 1.12 2005/01/11 02:45:28 marc Exp $ */ /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman */ -#include #include #include diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index bd4a97cc3ca..45eef849d38 100644 --- a/lib/libskey/skeylogin.c +++ b/lib/libskey/skeylogin.c @@ -10,10 +10,9 @@ * * S/Key verification check, lookups, and authentication. * - * $OpenBSD: skeylogin.c,v 1.55 2013/11/29 19:00:51 deraadt Exp $ + * $OpenBSD: skeylogin.c,v 1.56 2015/01/16 16:48:52 deraadt Exp $ */ -#include #ifdef QUOTA #include #endif @@ -32,6 +31,7 @@ #include #include #include +#include #include #include "skey.h" diff --git a/lib/libsndio/mio.c b/lib/libsndio/mio.c index 0501dd1b522..ffdd5714290 100644 --- a/lib/libsndio/mio.c +++ b/lib/libsndio/mio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mio.c,v 1.18 2013/11/13 22:38:22 ratchov Exp $ */ +/* $OpenBSD: mio.c,v 1.19 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -15,7 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include diff --git a/lib/libsndio/mio_priv.h b/lib/libsndio/mio_priv.h index 4b58affb342..7b3c39fecc1 100644 --- a/lib/libsndio/mio_priv.h +++ b/lib/libsndio/mio_priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mio_priv.h,v 1.10 2013/11/13 22:38:22 ratchov Exp $ */ +/* $OpenBSD: mio_priv.h,v 1.11 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -17,7 +17,6 @@ #ifndef MIO_PRIV_H #define MIO_PRIV_H -#include #include "sndio.h" #define MIO_MAXNFDS 16 diff --git a/lib/libsndio/sio.c b/lib/libsndio/sio.c index aaee7001c2c..576da94ee3e 100644 --- a/lib/libsndio/sio.c +++ b/lib/libsndio/sio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio.c,v 1.18 2014/08/10 09:11:07 jsg Exp $ */ +/* $OpenBSD: sio.c,v 1.19 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -15,7 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include diff --git a/lib/libsndio/sio_priv.h b/lib/libsndio/sio_priv.h index b74647fa683..fd310142793 100644 --- a/lib/libsndio/sio_priv.h +++ b/lib/libsndio/sio_priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sio_priv.h,v 1.8 2014/03/05 20:40:49 ratchov Exp $ */ +/* $OpenBSD: sio_priv.h,v 1.9 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -17,7 +17,6 @@ #ifndef SNDIO_PRIV_H #define SNDIO_PRIV_H -#include #include "sndio.h" #define SIO_MAXNFDS 16 diff --git a/lib/libutil/readlabel.c b/lib/libutil/readlabel.c index 1260d7b27f5..e2cee311d28 100644 --- a/lib/libutil/readlabel.c +++ b/lib/libutil/readlabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readlabel.c,v 1.12 2014/06/30 00:25:37 deraadt Exp $ */ +/* $OpenBSD: readlabel.c,v 1.13 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include #define DKTYPENAMES @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ char * readlabelfs(char *device, int verbose) { - char rpath[MAXPATHLEN]; + char rpath[PATH_MAX]; struct dk_diskmap dm; struct disklabel dk; char part, *type; -- 2.20.1