Print this page
10100 Illumos is confused about calloc() arguments
@@ -11,11 +11,13 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
/*
* checknr: check an nroff/troff input file for matching macro calls.
* we also attempt to match size and font changes, but only the embedded
* kind. These must end in \s0 and \fP resp. Maybe more sophistication
@@ -188,11 +190,11 @@
(void) setlocale(LC_ALL, "");
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
- stk = (struct stkstr *)calloc(sizeof (struct stkstr), 100);
+ stk = (struct stkstr *)calloc(100, sizeof (struct stkstr));
maxstk = 100;
/* Figure out how many known commands there are */
while (knowncmds[ncmds])
ncmds++;
while (argc > 1 && argv[1][0] == '-') {