summaryrefslogtreecommitdiffstats
path: root/lib/libspl
diff options
context:
space:
mode:
authorTomohiro Kusumi <[email protected]>2018-04-13 02:50:39 +0900
committerBrian Behlendorf <[email protected]>2018-04-12 10:50:39 -0700
commit8111eb4abc96a173845a553dc7d65382398f0683 (patch)
treeeca13f7bad728d865cffe4131dac3962f52b29ef /lib/libspl
parent7403d0743e2b75b7f5412a14007ba159efb67a7d (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tomohiro Kusumi <[email protected]> Closes #7405
Diffstat (limited to 'lib/libspl')
-rw-r--r--lib/libspl/mkdirp.c2
1 files changed, 1 insertions, 1 deletions
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);
}