summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-02-06 23:21:58 +0000
committermillert <millert@openbsd.org>2015-02-06 23:21:58 +0000
commit4239b8225fa4f64aecb5a0fe486abd01f9e64ae2 (patch)
treebc2da4d9ac9052268d9b8328f3ed7de2e42e1e1f /lib
parentlist iwm(4) in pci(4); prodded by jmc (diff)
downloadwireguard-openbsd-4239b8225fa4f64aecb5a0fe486abd01f9e64ae2.tar.xz
wireguard-openbsd-4239b8225fa4f64aecb5a0fe486abd01f9e64ae2.zip
SIZE_MAX is standard, we should be using it in preference to the
obsolete SIZE_T_MAX. OK miod@ beck@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getusershell.c5
-rw-r--r--lib/libc/gen/nlist.c8
-rw-r--r--lib/libc/stdio/getdelim.c5
-rw-r--r--lib/libedit/readline.c5
-rw-r--r--lib/libfuse/fuse_opt.c5
5 files changed, 16 insertions, 12 deletions
diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c
index c3517b19e06..0bcbf0b0464 100644
--- a/lib/libc/gen/getusershell.c
+++ b/lib/libc/gen/getusershell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getusershell.c,v 1.14 2014/09/15 06:15:48 guenther Exp $ */
+/* $OpenBSD: getusershell.c,v 1.15 2015/02/06 23:21:58 millert Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -33,6 +33,7 @@
#include <ctype.h>
#include <limits.h>
#include <paths.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -101,7 +102,7 @@ initshells(void)
(void)fclose(fp);
return (okshells);
}
- if (statb.st_size > SIZE_T_MAX) {
+ if (statb.st_size > SIZE_MAX) {
(void)fclose(fp);
return (okshells);
}
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 73ac65b52e7..1c1e3ceab10 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.58 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: nlist.c,v 1.59 2015/02/06 23:21:58 millert Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,11 +34,11 @@
#include <errno.h>
#include <fcntl.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <limits.h>
#include <a.out.h> /* pulls in nlist.h */
#ifdef _NLIST_DO_ELF
@@ -111,7 +111,7 @@ __fdnlist(int fd, struct nlist *list)
shdr_size = ehdr.e_shentsize * ehdr.e_shnum;
/* Make sure it's not too big to mmap */
- if (shdr_size > SIZE_T_MAX) {
+ if (shdr_size > SIZE_MAX) {
errno = EFBIG;
return (-1);
}
@@ -154,7 +154,7 @@ __fdnlist(int fd, struct nlist *list)
/* Check for files too large to mmap. */
/* XXX is this really possible? */
- if (symstrsize > SIZE_T_MAX) {
+ if (symstrsize > SIZE_MAX) {
errno = EFBIG;
return (-1);
}
diff --git a/lib/libc/stdio/getdelim.c b/lib/libc/stdio/getdelim.c
index 5e583cb5552..faf245ca6b1 100644
--- a/lib/libc/stdio/getdelim.c
+++ b/lib/libc/stdio/getdelim.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getdelim.c,v 1.2 2014/10/16 17:31:51 millert Exp $ */
+/* $OpenBSD: getdelim.c,v 1.3 2015/02/06 23:21:58 millert Exp $ */
/* $NetBSD: getdelim.c,v 1.13 2011/07/22 23:12:30 joerg Exp $ */
/*
@@ -30,6 +30,7 @@
#include <errno.h>
#include <limits.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -96,7 +97,7 @@ getdelim(char **__restrict buf, size_t *__restrict buflen,
newlen |= newlen >> 4;
newlen |= newlen >> 8;
newlen |= newlen >> 16;
-#if SIZE_T_MAX > 0xffffffffU
+#if SIZE_MAX > 0xffffffffU
newlen |= newlen >> 32;
#endif
newlen++;
diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c
index 814c865899d..92c52cf9058 100644
--- a/lib/libedit/readline.c
+++ b/lib/libedit/readline.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readline.c,v 1.13 2015/01/13 08:33:12 reyk Exp $ */
+/* $OpenBSD: readline.c,v 1.14 2015/02/06 23:21:58 millert Exp $ */
/* $NetBSD: readline.c,v 1.91 2010/08/28 15:44:59 christos Exp $ */
/*-
@@ -34,6 +34,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <stdint.h>
#include <stdio.h>
#include <dirent.h>
#include <string.h>
@@ -2133,7 +2134,7 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
}
qsort(&list[1], len - 1, sizeof(*list),
(int (*)(const void *, const void *)) strcmp);
- min = SIZE_T_MAX;
+ min = SIZE_MAX;
for (i = 1, a = list[i]; i < len - 1; i++, a = b) {
b = list[i + 1];
for (j = 0; a[j] && a[j] == b[j]; j++)
diff --git a/lib/libfuse/fuse_opt.c b/lib/libfuse/fuse_opt.c
index ff8f0af86a9..8919f11c18d 100644
--- a/lib/libfuse/fuse_opt.c
+++ b/lib/libfuse/fuse_opt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_opt.c,v 1.11 2014/10/08 04:50:10 deraadt Exp $ */
+/* $OpenBSD: fuse_opt.c,v 1.12 2015/02/06 23:21:58 millert Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
* Copyright (c) 2013 Stefan Sperling <stsp@openbsd.org>
@@ -17,6 +17,7 @@
*/
#include <assert.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -174,7 +175,7 @@ fuse_opt_add_opt_escaped(char **opts, const char *opt)
while (*s) {
/* malloc(size + escaped) overflow check */
- if (size >= (SIZE_T_MAX / 2))
+ if (size >= (SIZE_MAX / 2))
return (-1);
if (*s == ',' || *s == '\\')