logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: cc4d8780a1634f5c41084461eade02115b024c47
parent 7ecc44801826f8a3c80b093851ace4357e266a45
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 13 Sep 2024 23:19:04 +0200

cmd/paste: use calloc for arrays

Diffstat:

Mcmd/paste.c2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/paste.c b/cmd/paste.c @@ -71,7 +71,7 @@ main(int argc, char *argv[]) arg = optarg; len = mbsrtowcs(NULL, &arg, 0, NULL); if(len == (size_t)-1) err(1, "delimiters"); - warg = malloc((len + 1) * sizeof(*warg)); + warg = calloc((len + 1), sizeof(*warg)); if(warg == NULL) err(1, NULL); arg = optarg; len = mbsrtowcs(warg, &arg, len + 1, NULL);