Non-zero'd malloc wreaking havoc in OS X 10.8 #13

Merged
merged 1 commit into from Aug 17, 2012
View
2 src/watch.c
@@ -131,7 +131,7 @@ length(char **strs) {
char *
join(char **strs, int len, char *val) {
--len;
- char *buf = malloc(length(strs) + len * strlen(val));
+ char *buf = calloc(1, length(strs) + len * strlen(val));
char *str;
while ((str = *strs++)) {
strcat(buf, str);