+/*
+ * Check for a disparity between the number of arguments a function
+ * is called with and the number which we expect to see.
+ * If the error is unrecoverable, return 1, otherwise 0.
+ */
+argcounterr(args, callargs, name)
+ int args, callargs;
+ char *name;
+{
+ register char *cp;
+ char namebuf[MAXLINELEN];
+
+ if (args == callargs)
+ return (0);
+ cp = strcpy(namebuf, name);
+ while (*cp != '\0' && *cp != '\n')
+ ++cp;
+ if (*cp == '\n')
+ *cp = '\0';
+ if (callargs >= 0) {
+ fprintf(stderr,
+ "%s: error: arg count mismatch, %d != %d for '%s' at line %d\n",
+ whoami, callargs, args, namebuf, lineno);
+ return (1);
+ }
+ fprintf(stderr,
+ "%s: warning: can't verify arg count for '%s' at line %d\n",
+ whoami, namebuf, lineno);
+ return (0);
+}
+