[Redbutton-devel] SF.net SVN: redbutton: [38] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-05-02 11:29:54
|
Revision: 38 Author: skilvington Date: 2006-05-02 04:29:45 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=38&view=rev Log Message: ----------- add safe_mallocz Modified Paths: -------------- redbutton-browser/trunk/utils.c redbutton-browser/trunk/utils.h Modified: redbutton-browser/trunk/utils.c =================================================================== --- redbutton-browser/trunk/utils.c 2006-04-03 11:02:48 UTC (rev 37) +++ redbutton-browser/trunk/utils.c 2006-05-02 11:29:45 UTC (rev 38) @@ -113,6 +113,16 @@ return buf; } +void * +safe_mallocz(size_t nbytes) +{ + void *buf = safe_malloc(nbytes); + + bzero(buf, nbytes); + + return buf; +} + /* * safe_realloc(NULL, n) == safe_malloc(n) * safe_realloc(x, 0) == safe_free(x) and returns NULL Modified: redbutton-browser/trunk/utils.h =================================================================== --- redbutton-browser/trunk/utils.h 2006-04-03 11:02:48 UTC (rev 37) +++ redbutton-browser/trunk/utils.h 2006-05-02 11:29:45 UTC (rev 38) @@ -38,6 +38,7 @@ int next_utf8(unsigned char *, int, int *); void *safe_malloc(size_t); +void *safe_mallocz(size_t); void *safe_realloc(void *, size_t); void safe_free(void *); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |