From: msawyer@mael.soest.hawaii.edu (Michael Sawyer)
Subject: Patch for MCM program
Originator: cwatters@top.magnus.acs.ohio-state.edu
Organization: School of Ocean and Earth Science and Technology
Date: Fri, 25 Dec 1992 00:28:34 GMT

I have found a few bugs in the MCM program (used for online game
sessions), and have a patch available to any interested parties.  I am
going to spend a few days making sure that there are no other bugs,
and will then upload the patches to the various FTP sites.

If you want a copy of the patch, send E-Mail to
msawyer@soest.hawaii.edu.

[MODERATOR:  Here is the patch.  If you think it is short enough to be
included in the post, and is appropriate to the group, feel free to
include it.]

To apply the patch, save this message to a file, and type the command
"patch mcm.c filename" where filename is the name you used in saving
the file.  (You need not strip the headers or trailers off for most
versions of patch.)

*** dist/mcm.c	Thu Aug 20 11:25:19 1992
--- mcm.c	Thu Dec 24 14:08:02 1992
***************
*** 1114,1119 ****
--- 1114,1137 ----
    return;
  }
  
+ /* These are here to fix a bug in some versions of toupper() and tolower() */
+ char xtoupper(a)
+ char a;
+ {
+   if (islower(a))
+     return (toupper(a));
+   else
+     return (a);
+ }
+ char xtolower(a)
+ char a;
+ {
+   if (isupper(a))
+     return (tolower(a));
+   else
+     return (a);
+ }
+ 
  void strcap(string)
  char *string;
  {
***************
*** 1120,1126 ****
    int i;
  
    for (i=0;i<strlen(string);i++)
!     string[i]=toupper(string[i]);
  }
  void struncap(string)
  char *string;
--- 1138,1144 ----
    int i;
  
    for (i=0;i<strlen(string);i++)
!     string[i]=xtoupper(string[i]);
  }
  void struncap(string)
  char *string;
***************
*** 1128,1134 ****
    int i;
  
    for (i=0;i<strlen(string);i++)
!     string[i]=tolower(string[i]);
  }
  
  void starcommand(msgfrom, command)
--- 1146,1152 ----
    int i;
  
    for (i=0;i<strlen(string);i++)
!     string[i]=xtolower(string[i]);
  }
  
  void starcommand(msgfrom, command)
***************
*** 1147,1153 ****
    }
    if (strncmp("E!",command,2)==0)
      bailout(0,"Coordinator shutdown");
!   command[0]=toupper(command[0]);
    if ((msgfrom!=0)&&(strchr("DGTOLKM",command[0])==NULL))
    {
      command[0]='?';
--- 1165,1171 ----
    }
    if (strncmp("E!",command,2)==0)
      bailout(0,"Coordinator shutdown");
!   command[0]=xtoupper(command[0]);
    if ((msgfrom!=0)&&(strchr("DGTOLKM",command[0])==NULL))
    {
      command[0]='?';
***************
*** 1216,1222 ****
  
    if (!per_mode(msgfrom,command))
      return;
!   switch (toupper(command[0]))
    {
    case 'S':
      if (command[1]=='+')
--- 1234,1240 ----
  
    if (!per_mode(msgfrom,command))
      return;
!   switch (xtoupper(command[0]))
    {
    case 'S':
      if (command[1]=='+')
***************
*** 1316,1322 ****
    if (!testjob(msgfrom))
      return;
  
!   command[0]=toupper(command[0]);
    switch (command[0])
    {
    case 'W':
--- 1334,1340 ----
    if (!testjob(msgfrom))
      return;
  
!   command[0]=xtoupper(command[0]);
    switch (command[0])
    {
    case 'W':
***************
*** 1590,1595 ****
--- 1608,1615 ----
  	sides=atoi(textptr);
        else
  	sides=6;
+       if (sides==0)
+ 	sides=2;
        while ((textptr[0]!='+')&&(textptr[0]!='-')&&(textptr[0]!=0))
  	textptr++;
        if ((textptr[0]=='+')||(textptr[0]=='-'))
***************
*** 1708,1714 ****
    char string[80];
    char substring[40];
  
!   if (toupper(command[0]=='U'))
    {
      tell (-1,msgfrom,"(info)","Users currently logged into the system");
      j=0;
--- 1728,1734 ----
    char string[80];
    char substring[40];
  
!   if (xtoupper(command[0]=='U'))
    {
      tell (-1,msgfrom,"(info)","Users currently logged into the system");
      j=0;
-- 
Michael Sawyer		msawyer@mael.soest.hawaii.edu
University of Hawaii Physical Oceanography/Satellite Remote Sensing

Newsgroups: rec.games.frp.advocacy