summaryrefslogtreecommitdiffstatshomepage
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
commita1af4f3969c284fb243f1c0534b332232d54dd98 (patch)
treea6470eccaa1d9774d21bfaf1de23bed99b2d5a75 /mandoc.c
parentb9ac7e789aa2c1bf358e1d967a0b87ef2322744b (diff)
downloadmandoc-a1af4f3969c284fb243f1c0534b332232d54dd98.tar.gz
mandoc-a1af4f3969c284fb243f1c0534b332232d54dd98.tar.zst
mandoc-a1af4f3969c284fb243f1c0534b332232d54dd98.zip
Using perror() instead of fprintf for failure from library functions.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mandoc.c b/mandoc.c
index 068b365d..7e880d47 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.5 2009/10/30 05:58:38 kristaps Exp $ */
+/* $Id: mandoc.c,v 1.6 2009/10/31 06:10:58 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
}