summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/calloc.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-04-02 18:22:14 +0000
committerotto <otto@openbsd.org>2006-04-02 18:22:14 +0000
commit035204b7c00953ce6ce8199f0e300df39d07c1dc (patch)
treee5c7f298cbfb24b0f3c1f28c171055c7783ddf37 /lib/libc/stdlib/calloc.c
parentfix ^W (delete to start of word) in minibuffer; (diff)
downloadwireguard-openbsd-035204b7c00953ce6ce8199f0e300df39d07c1dc.tar.xz
wireguard-openbsd-035204b7c00953ce6ce8199f0e300df39d07c1dc.zip
Use SIZE_MAX instead of SIZE_T_MAX, the latter is not POSIX and
remove redundant check on size. ok millert@ deraadt@
Diffstat (limited to 'lib/libc/stdlib/calloc.c')
-rw-r--r--lib/libc/stdlib/calloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/calloc.c b/lib/libc/stdlib/calloc.c
index 7105141db82..43a0d1632ca 100644
--- a/lib/libc/stdlib/calloc.c
+++ b/lib/libc/stdlib/calloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: calloc.c,v 1.10 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: calloc.c,v 1.11 2006/04/02 18:22:14 otto Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -38,7 +38,7 @@ calloc(size_t num, size_t size)
{
void *p;
- if (num && size && SIZE_T_MAX / num < size) {
+ if (num && SIZE_MAX / num < size) {
errno = ENOMEM;
return NULL;
}