]> diplodocus.org Git - nmh/commitdiff
argsplit(): Incorrect type used in sizeof calculation for array.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 13:44:15 +0000 (14:44 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 13:48:05 +0000 (14:48 +0100)
Switched to referring to the variable being assigned the resulting
memory rather than duplicating its type information.  Fixes 78211e93.

sbr/arglist.c

index cd88b86..ceac3f1 100644 (file)
@@ -50,7 +50,7 @@ argsplit(char *command, char **file, int *argp)
        }
     }
 
-    argvarray = (char **) mh_xmalloc((sizeof(char **) * (MAXARGS + 5)));
+    argvarray = (char **)mh_xmalloc(sizeof *argvarray * (MAXARGS + 5));
 
     /*
      * The simple case - no spaces or shell metacharacters