Hi,

Similar to previous patches replacing malloc & memset with calloc. This time in 
src/bin/cp/utils.c

Please let me know if this doesn't paste correctly this time. I suspect it's ok 
now. If not, I may just cry.

I also attached it (I hope that's not frowned upon).

Cheers!



Index: utils.c
===================================================================
RCS file: /cvs/src/bin/cp/utils.c,v
retrieving revision 1.33
diff -u -p -u -r1.33 utils.c
--- utils.c     11 Jul 2012 16:19:24 -0000      1.33
+++ utils.c     24 Apr 2014 00:51:42 -0000
@@ -63,10 +63,9 @@ copy_file(FTSENT *entp, int dne)
                        err(1, "malloc");
        }
        if (!zeroes) {
-               zeroes = malloc(MAXBSIZE);
+               zeroes = calloc(1, MAXBSIZE);
                if (!zeroes)
-                       err(1, "malloc");
-               memset(zeroes, 0, MAXBSIZE);
+                       err(1, "calloc");
        }
 
        if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {






-- 
Peter Malone <[email protected]>

Attachment: utils.patch
Description: Binary data

Reply via email to