Bug 35477 - Gnibbles tries to load level 0
Gnibbles tries to load level 0
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gnome-games (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Blandford
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-10 14:13 EDT by Jeff Ozvold
Modified: 2013-04-02 00:15 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-11 14:33:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Ozvold 2001-04-10 14:13:58 EDT
There's a bug in the random level code.  One time that it checks

       rand() % MAXLEVEL

       it forgets to add one.  Here is a patch:


diff -ur gnome-games-1.1.90/gnibbles/main.c gnome-games-1.1.90-jjo/gnibbles/main.c
--- gnome-games-1.1.90/gnibbles/main.c  Tue Apr  3 13:54:25 2001
+++ gnome-games-1.1.90-jjo/gnibbles/main.c      Tue Apr  3 13:52:41 2001
@@ -488,7 +488,7 @@
               if ((current_level < MAXLEVEL) && !properties->random)
                       current_level++;
               else if (properties->random) {
-                       tmp = rand () % MAXLEVEL;
+                       tmp = rand () % MAXLEVEL + 1;
                       while (tmp == current_level)
                               tmp = rand () % MAXLEVEL + 1;
                       current_level = tmp;
Comment 1 Jonathan Blandford 2001-07-09 20:00:55 EDT
fixed

Note You need to log in before you can comment on or make changes to this bug.