diff options
author | Damien Miller <djm@mindrot.org> | 2014-01-10 10:37:05 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-01-10 10:37:05 +1100 |
commit | 3e49853650448883685cfa32fa382d0ba6d51d48 (patch) | |
tree | cc8125afc2ef7cf2ce3098e661b2eaba06c7367d /xmalloc.c | |
parent | a9c1e500ef609795cbc662848edb1a1dca279c81 (diff) |
- tedu@cvs.openbsd.org 2014/01/04 17:50:55
[mac.c monitor_mm.c monitor_mm.h xmalloc.c]
use standard types and formats for size_t like variables. ok dtucker
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: xmalloc.c,v 1.28 2013/05/17 00:13:14 djm Exp $ */ | 1 | /* $OpenBSD: xmalloc.c,v 1.29 2014/01/04 17:50:55 tedu Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -33,7 +33,7 @@ xmalloc(size_t size) | |||
33 | fatal("xmalloc: zero size"); | 33 | fatal("xmalloc: zero size"); |
34 | ptr = malloc(size); | 34 | ptr = malloc(size); |
35 | if (ptr == NULL) | 35 | if (ptr == NULL) |
36 | fatal("xmalloc: out of memory (allocating %lu bytes)", (u_long) size); | 36 | fatal("xmalloc: out of memory (allocating %zu bytes)", size); |
37 | return ptr; | 37 | return ptr; |
38 | } | 38 | } |
39 | 39 | ||
@@ -48,8 +48,8 @@ xcalloc(size_t nmemb, size_t size) | |||
48 | fatal("xcalloc: nmemb * size > SIZE_T_MAX"); | 48 | fatal("xcalloc: nmemb * size > SIZE_T_MAX"); |
49 | ptr = calloc(nmemb, size); | 49 | ptr = calloc(nmemb, size); |
50 | if (ptr == NULL) | 50 | if (ptr == NULL) |
51 | fatal("xcalloc: out of memory (allocating %lu bytes)", | 51 | fatal("xcalloc: out of memory (allocating %zu bytes)", |
52 | (u_long)(size * nmemb)); | 52 | size * nmemb); |
53 | return ptr; | 53 | return ptr; |
54 | } | 54 | } |
55 | 55 | ||
@@ -68,8 +68,8 @@ xrealloc(void *ptr, size_t nmemb, size_t size) | |||
68 | else | 68 | else |
69 | new_ptr = realloc(ptr, new_size); | 69 | new_ptr = realloc(ptr, new_size); |
70 | if (new_ptr == NULL) | 70 | if (new_ptr == NULL) |
71 | fatal("xrealloc: out of memory (new_size %lu bytes)", | 71 | fatal("xrealloc: out of memory (new_size %zu bytes)", |
72 | (u_long) new_size); | 72 | new_size); |
73 | return new_ptr; | 73 | return new_ptr; |
74 | } | 74 | } |
75 | 75 | ||