summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-04-04 16:19:44 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-04-04 16:19:44 +0000
commit4e02769db96ead5e7b5091ecae38284559ac8afb (patch)
tree43466edd9b91bbf1e178d3b6dedab8233013c123 /usr.bin
parent442b999f15a6f6c66dd2cfa1a022d5544583ff94 (diff)
fatalx() not fatal().
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/xmalloc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/tmux/xmalloc.c b/usr.bin/tmux/xmalloc.c
index e00074c9407..d1a3dc587c6 100644
--- a/usr.bin/tmux/xmalloc.c
+++ b/usr.bin/tmux/xmalloc.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: xmalloc.c,v 1.9 2015/11/18 13:06:54 nicm Exp $ */
+/* $OpenBSD: xmalloc.c,v 1.10 2016/04/04 16:19:43 nicm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
* Versions of malloc and friends that check their results, and never return
- * failure (they call fatal if they encounter an error).
+ * failure (they call fatalx if they encounter an error).
*
* As far as I am concerned, the code I have written for this software
* can be used freely for any purpose. Any derived versions of this
@@ -29,10 +29,10 @@ xmalloc(size_t size)
void *ptr;
if (size == 0)
- fatal("xmalloc: zero size");
+ fatalx("xmalloc: zero size");
ptr = malloc(size);
if (ptr == NULL)
- fatal("xmalloc: allocating %zu bytes: %s",
+ fatalx("xmalloc: allocating %zu bytes: %s",
size, strerror(errno));
return ptr;
}
@@ -43,10 +43,10 @@ xcalloc(size_t nmemb, size_t size)
void *ptr;
if (size == 0 || nmemb == 0)
- fatal("xcalloc: zero size");
+ fatalx("xcalloc: zero size");
ptr = calloc(nmemb, size);
if (ptr == NULL)
- fatal("xcalloc: allocating %zu * %zu bytes: %s",
+ fatalx("xcalloc: allocating %zu * %zu bytes: %s",
nmemb, size, strerror(errno));
return ptr;
}
@@ -63,10 +63,10 @@ xreallocarray(void *ptr, size_t nmemb, size_t size)
void *new_ptr;
if (nmemb == 0 || size == 0)
- fatal("xreallocarray: zero size");
+ fatalx("xreallocarray: zero size");
new_ptr = reallocarray(ptr, nmemb, size);
if (new_ptr == NULL)
- fatal("xreallocarray: allocating %zu * %zu bytes: %s",
+ fatalx("xreallocarray: allocating %zu * %zu bytes: %s",
nmemb, size, strerror(errno));
return new_ptr;
}
@@ -77,7 +77,7 @@ xstrdup(const char *str)
char *cp;
if ((cp = strdup(str)) == NULL)
- fatal("xstrdup: %s", strerror(errno));
+ fatalx("xstrdup: %s", strerror(errno));
return cp;
}
@@ -102,7 +102,7 @@ xvasprintf(char **ret, const char *fmt, va_list ap)
i = vasprintf(ret, fmt, ap);
if (i < 0 || *ret == NULL)
- fatal("xasprintf: %s", strerror(errno));
+ fatalx("xasprintf: %s", strerror(errno));
return i;
}
@@ -126,12 +126,12 @@ xvsnprintf(char *str, size_t len, const char *fmt, va_list ap)
int i;
if (len > INT_MAX)
- fatal("xsnprintf: len > INT_MAX");
+ fatalx("xsnprintf: len > INT_MAX");
i = vsnprintf(str, len, fmt, ap);
if (i < 0 || i >= (int)len)
- fatal("xsnprintf: overflow");
+ fatalx("xsnprintf: overflow");
return i;
}