Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
a443156
)
Tweaked _new_array() to handle new use_calloc parameter.
author
Wayne Davison
<wayned@samba.org>
Mon, 3 Sep 2007 04:19:02 +0000
(
04:19
+0000)
committer
Wayne Davison
<wayned@samba.org>
Mon, 3 Sep 2007 04:19:02 +0000
(
04:19
+0000)
util.c
patch
|
blob
|
blame
|
history
diff --git
a/util.c
b/util.c
index
656c3bf
..
7ec334e
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-1255,11
+1255,11
@@
int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6)
#define MALLOC_MAX 0x40000000
-void *_new_array(unsigned
int size, unsigned long num
)
+void *_new_array(unsigned
long num, unsigned int size, int use_calloc
)
{
if (num >= MALLOC_MAX/size)
return NULL;
- return
malloc(size * num
);
+ return
use_calloc ? calloc(num, size) : malloc(num * size
);
}
void *_realloc_array(void *ptr, unsigned int size, unsigned long num)