projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23f854c
)
* mh_xmalloc(), mh_xrealloc(), pwd(): Add comments describing the purpose
author
Josh Bressers
<josh@bress.net>
Wed, 4 Jan 2006 02:10:25 +0000
(
02:10
+0000)
committer
Josh Bressers
<josh@bress.net>
Wed, 4 Jan 2006 02:10:25 +0000
(
02:10
+0000)
of the function.
sbr/utils.c
patch
|
blob
|
history
diff --git
a/sbr/utils.c
b/sbr/utils.c
index
c25e02d
..
2120b84
100644
(file)
--- a/
sbr/utils.c
+++ b/
sbr/utils.c
@@
-13,6
+13,9
@@
#include <h/utils.h>
#include <stdlib.h>
+/*
+ * 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)
{