summaryrefslogtreecommitdiffstats
path: root/mandoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-31 06:10:57 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-31 06:10:57 +0000
commitfecec57074220c2494d1098ec3e1fa90362a1e44 (patch)
tree496a201f25ed00e58a64f0ead626620bb1c08a5e /mandoc.c
parent9b34de59b184407dc87af383dc2b149c837e3b8b (diff)
downloadmandoc-fecec57074220c2494d1098ec3e1fa90362a1e44.tar.gz
Using perror() instead of fprintf for failure from library functions.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mandoc.c b/mandoc.c
index 9c4328e6..b9d554af 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -113,7 +113,7 @@ mandoc_calloc(size_t num, size_t size)
ptr = calloc(num, size);
if (NULL == ptr) {
- fprintf(stderr, "memory exhausted\n");
+ perror(NULL);
exit(EXIT_FAILURE);
}
@@ -128,7 +128,7 @@ mandoc_malloc(size_t size)
ptr = malloc(size);
if (NULL == ptr) {
- fprintf(stderr, "memory exhausted\n");
+ perror(NULL);
exit(EXIT_FAILURE);
}
@@ -142,7 +142,7 @@ mandoc_realloc(void *ptr, size_t size)
ptr = realloc(ptr, size);
if (NULL == ptr) {
- fprintf(stderr, "memory exhausted\n");
+ perror(NULL);
exit(EXIT_FAILURE);
}
@@ -157,7 +157,7 @@ mandoc_strdup(const char *ptr)
p = strdup(ptr);
if (NULL == p) {
- fprintf(stderr, "memory exhausted\n");
+ perror(NULL);
exit(EXIT_FAILURE);
}