note called safe_calloc because calloc does not have the same syntax
and this safe_malloc0 uses malloc syntax
+void *safe_malloc0( size_t size ){
+ void *p;
+
+ p = calloc( 1, size );
+ if ( !p ) {
+ Error( "safe_malloc0 failed on allocation of %i bytes", size );
+ }
+
+ return p;
+}
+
+void *safe_malloc0_info( size_t size, char* info ){
+ void *p;
+
+ p = calloc( 1, size );
+ if ( !p ) {
+ Error( "%s: safe_malloc0 failed on allocation of %i bytes", info, size );
+ }
+
+ return p;
+}
+
// set these before calling CheckParm
int myargc;
char **myargv;
// set these before calling CheckParm
int myargc;
char **myargv;
void *safe_malloc( size_t size );
void *safe_malloc_info( size_t size, char* info );
void *safe_malloc( size_t size );
void *safe_malloc_info( size_t size, char* info );
+void *safe_malloc0( size_t size );
+void *safe_malloc0_info( size_t size, char* info );
// set these before calling CheckParm
extern int myargc;
// set these before calling CheckParm
extern int myargc;