From 8f0c973e6cfebb193010714453f70f55ceae5dd7 Mon Sep 17 00:00:00 2001 From: Josh Bressers Date: Wed, 4 Jan 2006 02:10:25 +0000 Subject: [PATCH] * mh_xmalloc(), mh_xrealloc(), pwd(): Add comments describing the purpose of the function. --- sbr/utils.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sbr/utils.c b/sbr/utils.c index c25e02d..2120b84 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -13,6 +13,9 @@ #include #include +/* + * Safely call malloc + */ void * mh_xmalloc(size_t size) { @@ -28,6 +31,9 @@ mh_xmalloc(size_t size) return memory; } +/* + * Safely call realloc + */ void * mh_xrealloc(void *ptr, size_t size) { @@ -42,6 +48,11 @@ mh_xrealloc(void *ptr, size_t size) return memory; } + +/* + * Return the present working directory, if the current directory does not + * exist, or is too long, make / the pwd. + */ char * pwd(void) { -- 1.7.10.4