From: Josh Bressers Date: Wed, 4 Jan 2006 02:10:25 +0000 (+0000) Subject: * mh_xmalloc(), mh_xrealloc(), pwd(): Add comments describing the purpose X-Git-Tag: nmh-1_3_RC1~77 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=8f0c973e6cfebb193010714453f70f55ceae5dd7 * mh_xmalloc(), mh_xrealloc(), pwd(): Add comments describing the purpose of the function. --- 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) {