Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwpl.git;a=commitdiff;h=3e42db72378f1f6600fefc8ab5b86e0d03107d39

commit 3e42db72378f1f6600fefc8ab5b86e0d03107d39
Author: James Buren <r...@frugalware.org>
Date:   Mon Sep 21 15:31:40 2009 -0500

utility.c
* add xrealloc function

diff --git a/src/utility.c b/src/utility.c
index 0a911e4..0e83d2e 100644
--- a/src/utility.c
+++ b/src/utility.c
@@ -24,6 +24,20 @@ void *xmalloc(size_t size) {
return ptr;
}
//[cf]
+//[of]:xrealloc
+void *xrealloc(void *ptr,size_t size) {
+  assert((ptr != NULL) and (size > 0));
+
+  ptr = realloc(ptr,size);
+
+  if(!ptr) {
+    eprintf("Failed to reallocate memory block of %u bytes.\n",size);
+    abort();
+  }
+
+  return ptr;
+}
+//[cf]
//[of]:xstrdup
char *xstrdup(const char *src) {
char *dest;
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to