]> git.cameronkatri.com Git - bsdgames-darwin.git/commitdiff
nextfree() was not returning a value when it pulled something off the free
authormycroft <mycroft@NetBSD.org>
Fri, 3 Dec 1993 09:32:55 +0000 (09:32 +0000)
committermycroft <mycroft@NetBSD.org>
Fri, 3 Dec 1993 09:32:55 +0000 (09:32 +0000)
list.  Reported by vandys@cisco.com and Mark_Weaver@brown.edu.

backgammon/backgammon/move.c

index c0deffb57935ba0562bf24c25fef6789506db2b7..e0f1521c326579b54d94a16b75dcb9ca53c715a5 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifndef lint
 /*static char sccsid[] = "from: @(#)move.c     5.6 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: move.c,v 1.2 1993/08/01 18:56:55 mycroft Exp $";
+static char rcsid[] = "$Id: move.c,v 1.3 1993/12/03 09:32:55 mycroft Exp $";
 #endif /* not lint */
 
 #include "back.h"
@@ -349,12 +349,13 @@ nextfree ()  {
                        writel ("\nOut of memory\n");
                        getout();
                }
-               new->b_next = 0;
-               return (new);
+       } else {
+               new = freeq;
+               freeq = freeq->b_next;
        }
 
-       new = freeq;
-       freeq = freeq->b_next;
+       new->b_next = 0;
+       return (new);
 }
 \f
 pickmove ()  {