summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/xmalloc.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-02-06 23:22:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-02-06 23:22:00 +0000
commit3318608864fcb14a5c03e4cf97495dbd6d23bfd7 (patch)
treee4103eeca8e2180f8253c294c942f6aa1de9c6f2 /usr.bin/ssh/xmalloc.c
parent80c4a98d1fdcc445a241d9895e7b7e684aacec71 (diff)
SIZE_MAX is standard, we should be using it in preference to the
obsolete SIZE_T_MAX. OK miod@ beck@
Diffstat (limited to 'usr.bin/ssh/xmalloc.c')
-rw-r--r--usr.bin/ssh/xmalloc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/ssh/xmalloc.c b/usr.bin/ssh/xmalloc.c
index a85acb7a566..d2bbfe2d0d3 100644
--- a/usr.bin/ssh/xmalloc.c
+++ b/usr.bin/ssh/xmalloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmalloc.c,v 1.30 2015/01/16 06:40:12 deraadt Exp $ */
+/* $OpenBSD: xmalloc.c,v 1.31 2015/02/06 23:21:59 millert Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -14,10 +14,10 @@
*/
#include <stdarg.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <limits.h>
#include "xmalloc.h"
#include "log.h"
@@ -42,8 +42,8 @@ xcalloc(size_t nmemb, size_t size)
if (size == 0 || nmemb == 0)
fatal("xcalloc: zero size");
- if (SIZE_T_MAX / nmemb < size)
- fatal("xcalloc: nmemb * size > SIZE_T_MAX");
+ if (SIZE_MAX / nmemb < size)
+ fatal("xcalloc: nmemb * size > SIZE_MAX");
ptr = calloc(nmemb, size);
if (ptr == NULL)
fatal("xcalloc: out of memory (allocating %zu bytes)",
@@ -59,8 +59,8 @@ xrealloc(void *ptr, size_t nmemb, size_t size)
if (new_size == 0)
fatal("xrealloc: zero size");
- if (SIZE_T_MAX / nmemb < size)
- fatal("xrealloc: nmemb * size > SIZE_T_MAX");
+ if (SIZE_MAX / nmemb < size)
+ fatal("xrealloc: nmemb * size > SIZE_MAX");
if (ptr == NULL)
new_ptr = malloc(new_size);
else