From 8111eb4abc96a173845a553dc7d65382398f0683 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Fri, 13 Apr 2018 02:50:39 +0900 Subject: Fix calloc(3) arguments order calloc(3) takes `nelem` (or `nmemb` in glibc) first, and then size of elements. No difference expected for having these in reverse order, however should follow the standard. http://pubs.opengroup.org/onlinepubs/009695399/functions/calloc.html Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Tomohiro Kusumi Closes #7405 --- lib/libspl/mkdirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libspl') diff --git a/lib/libspl/mkdirp.c b/lib/libspl/mkdirp.c index 2f091883a..541741752 100644 --- a/lib/libspl/mkdirp.c +++ b/lib/libspl/mkdirp.c @@ -166,7 +166,7 @@ simplify(const char *str) mbPathlen = strlen(mbPath); - if ((wcPath = calloc(sizeof (wchar_t), mbPathlen+1)) == NULL) { + if ((wcPath = calloc(mbPathlen+1, sizeof (wchar_t))) == NULL) { free(mbPath); return (NULL); } -- cgit v1.2.3