shithub: cuefs

Download patch

ref: 2e85824bfac2a2ff26e62acaa898328991e7521c
parent: 55bd2aa0f91dbbd025529b78db456ce68320fdd9
author: Tevo <estevan.cps@gmail.com>
date: Sun Feb 14 19:17:52 EST 2021

Couple more malloc → mallocz replacements

--- a/fs.c	Sun Feb 14 19:13:20 2021
+++ b/fs.c	Sun Feb 14 19:17:52 2021
@@ -139,7 +139,7 @@
 	if(pipe(fd) < 0)
 		sysfatal("pipedec: can't decode: pipe: %r");
 
-	ret = emalloc(sizeof(*ret));
+	ret = emallocz(sizeof(*ret), 1);
 	ret->cleanup = (void(*)(void*))closedec;
 	ret->fd = fd[0];
 	ret->curoff = off;
@@ -385,7 +385,7 @@
 	char **ret;
 	int c = 0;
 
-	ret = emalloc(sizeof(*ret));
+	ret = emallocz(sizeof(*ret), 1);
 
 	ret = spush(&c, ret, enc);
 	ret = tagflag(&c, ret, esmprint("TITLE=%s", e->title));
@@ -576,7 +576,7 @@
 	Fsprops *p;
 	char *s;
 
-	p = emalloc(sizeof(*p));
+	p = emallocz(sizeof(*p), 1);
 	p->sheet	= sheet;
 	p->outfmt	= (outfmt == -1) ? prefoutfmt(sheet->files->actual) : outfmt;
 	p->prefidx	= prefidx;