summaryrefslogtreecommitdiffstats
path: root/lib/libc
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/libc
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/libc')
-rw-r--r--lib/libc/gen/getusershell.c5
-rw-r--r--lib/libc/gen/nlist.c8
-rw-r--r--lib/libc/stdio/getdelim.c5
3 files changed, 10 insertions, 8 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++;