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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #7405
This commit is contained in:
Tomohiro Kusumi
2018-04-13 02:50:39 +09:00
committed by Brian Behlendorf
parent 7403d0743e
commit 8111eb4abc
6 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -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);
}