]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - gomoku/main.c
Use libcrypto's bignum support to implement a Pollard Rho factoring
[bsdgames-darwin.git] / gomoku / main.c
index e7f0448f45bda70f1a8c38adca360e535b2c83ae..3d5d862b27947b54c44a6aee184bf1ec93cdfc2f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.7 1999/09/08 21:45:27 jsm Exp $     */
+/*     $NetBSD: main.c,v 1.10 2000/05/08 07:56:03 mycroft Exp $        */
 
 /*
  * Copyright (c) 1994
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\n\
 #if 0
 static char sccsid[] = "@(#)main.c     8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.7 1999/09/08 21:45:27 jsm Exp $");
+__RCSID("$NetBSD: main.c,v 1.10 2000/05/08 07:56:03 mycroft Exp $");
 #endif
 #endif /* not lint */
 
@@ -98,6 +98,9 @@ main(argc, argv)
                "%3d        %-6s"
        };
 
+       /* Revoke setgid privileges */
+       setgid(getgid());
+
        color = curmove = 0;
 
        prog = strrchr(argv[0], '/');
@@ -259,7 +262,7 @@ again:
                                        ask("save file name? ");
                                        (void)getline(buf, sizeof(buf));
                                        if ((fp = fopen(buf, "w")) == NULL) {
-                                               log("cannot create save file");
+                                               glog("cannot create save file");
                                                goto getinput;
                                        }
                                        for (i = 0; i < movenum - 1; i++)
@@ -270,7 +273,7 @@ again:
                                }
                                if (curmove != RESIGN &&
                                    board[curmove].s_occ != EMPTY) {
-                                       log("Illegal move");
+                                       glog("Illegal move");
                                        goto getinput;
                                }
                        }
@@ -282,7 +285,7 @@ again:
                }
                if (interactive) {
                        sprintf(fmtbuf, fmt[color], movenum, stoc(curmove));
-                       log(fmtbuf);
+                       glog(fmtbuf);
                }
                if ((i = makemove(color, curmove)) != MOVEOK)
                        break;
@@ -319,7 +322,7 @@ again:
                                ask("save file name? ");
                                (void)getline(buf, sizeof(buf));
                                if ((fp = fopen(buf, "w")) == NULL) {
-                                       log("cannot create save file");
+                                       glog("cannot create save file");
                                        goto replay;
                                }
                                for (i = 0; i < movenum - 1; i++)
@@ -509,7 +512,7 @@ dlog(str)
 }
 
 void
-log(str)
+glog(str)
        const char *str;
 {