projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Replace mh_xmalloc() with mh_xcalloc()
[mmh]
/
sbr
/
getcpy.c
diff --git
a/sbr/getcpy.c
b/sbr/getcpy.c
index
478986a
..
77564a1
100644
(file)
--- a/
sbr/getcpy.c
+++ b/
sbr/getcpy.c
@@
-22,10
+22,10
@@
getcpy(char *str)
if (str) {
len = strlen(str) + 1;
- cp = mh_xmalloc(len);
+ cp = mh_xcalloc(len, sizeof(char));
memcpy(cp, str, len);
} else {
- cp = mh_xmalloc((size_t) 1);
+ cp = mh_xcalloc((size_t) 1, sizeof(char));
*cp = '\0';
}
return cp;