diff options
author | otto <> | 2006-04-02 18:22:14 +0000 |
---|---|---|
committer | otto <> | 2006-04-02 18:22:14 +0000 |
commit | b191a1bc418ee9a7b5c00effd8c2a765697490e8 (patch) | |
tree | 204f0febec86181ecf5b30c493a36a95a8639dcc /src/lib/libc/stdlib/calloc.c | |
parent | 2c17c479e3f19bd8ea43ac82f1e568b57ac52dfd (diff) | |
download | openbsd-b191a1bc418ee9a7b5c00effd8c2a765697490e8.tar.gz openbsd-b191a1bc418ee9a7b5c00effd8c2a765697490e8.tar.bz2 openbsd-b191a1bc418ee9a7b5c00effd8c2a765697490e8.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 '')
-rw-r--r-- | src/lib/libc/stdlib/calloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/calloc.c b/src/lib/libc/stdlib/calloc.c index 7105141db8..43a0d1632c 100644 --- a/src/lib/libc/stdlib/calloc.c +++ b/src/lib/libc/stdlib/calloc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: calloc.c,v 1.10 2005/08/08 08:05:36 espie Exp $ */ | 1 | /* $OpenBSD: calloc.c,v 1.11 2006/04/02 18:22:14 otto Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -38,7 +38,7 @@ calloc(size_t num, size_t size) | |||
38 | { | 38 | { |
39 | void *p; | 39 | void *p; |
40 | 40 | ||
41 | if (num && size && SIZE_T_MAX / num < size) { | 41 | if (num && SIZE_MAX / num < size) { |
42 | errno = ENOMEM; | 42 | errno = ENOMEM; |
43 | return NULL; | 43 | return NULL; |
44 | } | 44 | } |