diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2009-06-07 08:39:14 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2009-06-07 08:39:14 +0000 |
commit | 8896fb155a60da615a44f9b4f57e849d2d826fbb (patch) | |
tree | 9994931387b3cfb5f8e8de66ec0c5f2e63c4132b /usr.bin/rcs/xmalloc.c | |
parent | cf7eb25db5ce1f28444b090d61344d49803d57d3 (diff) |
More cvs/diff/rcs convergence:
1. Mostly variable/function renaming, SIZE_T_MAX->SIZE_MAX, and
spacing.
2. One strchr -> strncspn.
3. diff had a weird thing where it set file[12] = ofile[12] but
never updated file or ofile, then if file and ofile were different
it freed it. I removed it.
OK millert
Diffstat (limited to 'usr.bin/rcs/xmalloc.c')
-rw-r--r-- | usr.bin/rcs/xmalloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/rcs/xmalloc.c b/usr.bin/rcs/xmalloc.c index 31953559787..cb609588b81 100644 --- a/usr.bin/rcs/xmalloc.c +++ b/usr.bin/rcs/xmalloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xmalloc.c,v 1.3 2007/02/27 07:59:13 xsa Exp $ */ +/* $OpenBSD: xmalloc.c,v 1.4 2009/06/07 08:39:13 ray Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -44,8 +44,8 @@ xcalloc(size_t nmemb, size_t size) if (size == 0 || nmemb == 0) errx(1, "xcalloc: zero size"); - if (SIZE_T_MAX / nmemb < size) - errx(1, "xcalloc: nmemb * size > SIZE_T_MAX"); + if (SIZE_MAX / nmemb < size) + errx(1, "xcalloc: nmemb * size > SIZE_MAX"); ptr = calloc(nmemb, size); if (ptr == NULL) errx(1, "xcalloc: out of memory (allocating %lu bytes)", @@ -61,8 +61,8 @@ xrealloc(void *ptr, size_t nmemb, size_t size) if (new_size == 0) errx(1, "xrealloc: zero size"); - if (SIZE_T_MAX / nmemb < size) - errx(1, "xrealloc: nmemb * size > SIZE_T_MAX"); + if (SIZE_MAX / nmemb < size) + errx(1, "xrealloc: nmemb * size > SIZE_MAX"); if (ptr == NULL) new_ptr = malloc(new_size); else |