]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - boggle/mkdict/mkdict.c
Further warning fix for mkdict.
[bsdgames-darwin.git] / boggle / mkdict / mkdict.c
index e96bc5b9bb4b3e67568b685c67a7c465beab712e..b6e7d06714f8bc7a0d4c856c0796ec2c3522c6d5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkdict.c,v 1.4 1999/09/10 00:18:20 jsm Exp $   */
+/*     $NetBSD: mkdict.c,v 1.6 1999/09/19 18:10:48 jsm Exp $   */
 
 /*-
  * Copyright (c) 1993
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1993\n\
-       The Regents of the University of California.  All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1993\n\
+       The Regents of the University of California.  All rights reserved.\n");
 #endif /* not lint */
 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)mkdict.c   8.1 (Berkeley) 6/11/93";
 #else
-static char rcsid[] = "$NetBSD: mkdict.c,v 1.4 1999/09/10 00:18:20 jsm Exp $";
+__RCSID("$NetBSD: mkdict.c,v 1.6 1999/09/19 18:10:48 jsm Exp $");
 #endif
 #endif /* not lint */
 
@@ -66,21 +66,21 @@ static char rcsid[] = "$NetBSD: mkdict.c,v 1.4 1999/09/10 00:18:20 jsm Exp $";
 
 #include "bog.h"
 
+int main __P((int, char *[]));
+
 int
 main(argc, argv)
        int argc;
        char *argv[];
 {
        char *p, *q;
-       int ch, common, n, nwords;
+       int ch, common, nwords;
        int current, len, prev, qcount;
        char buf[2][MAXWORDLEN + 1];
 
        prev = 0;
        current = 1;
        buf[prev][0] = '\0';
-       if (argc == 2)
-               n = atoi(argv[1]);
 
        for (nwords = 1;
            fgets(buf[current], MAXWORDLEN + 1, stdin) != NULL; ++nwords) {
@@ -101,7 +101,7 @@ main(argc, argv)
                                if (*q != 'u')
                                        break;
                                else {
-                                       while (*q = *(q + 1))
+                                       while ((*q = *(q + 1)))
                                                q++;
                                }
                                len++;
@@ -110,7 +110,7 @@ main(argc, argv)
                }
                if (*p != '\n' || len < 3 || len > MAXWORDLEN)
                        continue;
-               if (argc == 2 && nwords % n)
+               if (argc == 2 && nwords % atoi(argv[1]))
                        continue;
 
                *p = '\0';