math/gfreduce.[ch]: Fix out-of-bounds memory access.
[u/mdw/catacomb] / math / group-test.c
index 7cd0cd2..493ee2f 100644 (file)
@@ -42,8 +42,11 @@ static group *getgroup(const char *p) {
   group *g; qd_parse qd;
   qd.p = p; qd.e = 0; g = group_parse(&qd);
   if (g && !qd_eofp(&qd)) { G_DESTROYGROUP(g); g = 0; qd.e = "junk at eof"; }
-  if (!g) { fprintf(stderr, "bad group string `%.*s|%s': %s\n", qd.p - p,
-                   p, qd.p, qd.e); exit(1); }
+  if (!g) {
+    fprintf(stderr, "bad group string `%.*s|%s': %s\n",
+           (int)(qd.p - p), p, qd.p, qd.e);
+    exit(1);
+  }
   return (g);
 }
 
@@ -75,8 +78,9 @@ static void showmp(const char *p, mp *x, int r) {
   putc('\n', stderr);
 }
 
-static int check(const char *op, const char *gd, group *g,
-                ge *r, ge *c, ...) {
+static int EXECL_LIKE(0)
+  check(const char *op, const char *gd, group *g, ge *r, ge *c, ...)
+{
   va_list ap;
 
   if (G_EQ(g, r, c)) return (1);