Print this page
10075 make usr/src/tools smatch clean

@@ -21,10 +21,14 @@
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 /*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
+/*
  * Finds all unreferenced files in a source tree that do not match a list of
  * permitted pathnames.
  */
 
 #include <ctype.h>

@@ -198,11 +202,11 @@
         char    *hgcmd = NULL;
         char    *newline;
         pnset_t *pnsetp;
         char    path[MAXPATHLEN];
 
-        pnsetp = calloc(sizeof (pnset_t), 1);
+        pnsetp = calloc(1, sizeof (pnset_t));
         if (pnsetp == NULL ||
             asprintf(&hgcmd, "hg manifest -R %s", hgroot) == -1)
                 goto fail;
 
         fp = popen(hgcmd, "r");

@@ -240,11 +244,11 @@
         char    *gitcmd = NULL;
         char    *newline;
         pnset_t *pnsetp;
         char    path[MAXPATHLEN];
 
-        pnsetp = calloc(sizeof (pnset_t), 1);
+        pnsetp = calloc(1, sizeof (pnset_t));
         if (pnsetp == NULL ||
             asprintf(&gitcmd, "git --git-dir=%s/.git ls-files", gitroot) == -1)
                 goto fail;
 
         fp = popen(gitcmd, "r");

@@ -398,11 +402,11 @@
         char            line[MAXPATHLEN];
         char            *newline;
         pnset_t         *pnsetp;
         unsigned int    i;
 
-        pnsetp = calloc(sizeof (pnset_t), 1);
+        pnsetp = calloc(1, sizeof (pnset_t));
         if (pnsetp == NULL)
                 return (NULL);
 
         /*
          * Add any exceptions from the file.