www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/18/06:07:16

From: sdarl AT why DOT net (Sed)
Newsgroups: comp.os.msdos.djgpp
Subject: RHIDE 1.1 Crash
Date: Tue, 18 Feb 1997 05:04:07 GMT
Organization: The Why? Network
Lines: 152
Message-ID: <330a380a.18093054@news.why.net>
Reply-To: sdarl AT why DOT net
NNTP-Posting-Host: 206.160.171.171
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

	Hello all,

  Using RHIDE 1.1 when I trace through a program, and it comes to this
function below, RHIDE closes down, and returns to the operating
system. 
 --When I normal run the program that contains this function, all goes
well.--
  Also, if I set a breakpoint somewhere in the middle of the function,
I can then step through it. Using unix based C compilers, I can trace
through normally, so I'm led to believe this is an RHIDE/DPMI server
issue. The shutdown happens upon entry to the function. The first
command in the function is not even executed. The function is also
called by main.

 The system I am using is a Pentitum 75 with 24 megs running Win95. I
have a Stealth 64 1Meg SE graphics card. My autoexec.bat and
config.sys contain nothing out of the ordinary, except a NOEMS switch
on EMM386. I run Rhide from inside Win95 under full screen Dos window.
Djgpp is installed and 100% operational otherwise.

 When RHIDE stops, it just disappears. The temp files are still in
place though, but RHIDE returns straight to Win95 which may mean that
Win95 is preempting a bad call.

 I was wondering if anyone else experienced this situation, and how it
may have been overcome. Since I don't have immediate access to another
DPMI server, I was wondering if it may be Win95 DPMI server.



--------------------------------------------------------------------------------------

int InputArray (char inarray[], int arraysize, int* invalue)

 /* This function gets the user input to be put into the character
    array inarray. Error checking is then performed to see if the
input
    does not overrun the array bounds of inarray. arraysize-1 is used
    to perform the overrun checking because inarray[arraysize] is
    acutally equal to '\0' if everything is error free.
    Then error checking is performed to make sure all characters in
the
    array are in the format [+/-]xxxx where x is equal to a single
digit
    integer. If this level of error checking is passed then the
integer
    value pointed to by int* intvar is set equal to the integer value
    of returned by the function ConvertArray. If all goes well this
    function returns a 0, otherwise it returns a 1. */

 /* Parameters: address of a character array is its corresponding
size,
                and a pointer to an integer value in memory. */

 /* Returns: 0 if OK, 1 if error condition. */
{
 char buffer[20]; /* <- A buffer to temporarily store user */
 char* bufferptr=NULL;
 int response, index;             /* input. And response is input
value */
                                  /* stored when the program verifies
*/
                                  /* correct operation from user. */

 bufferptr=gets(buffer);
                         /* gets returns pointer to buffer[] if
correct, */
                         /* or NULL if error condition in input. */

 
 if (bufferptr !=NULL ) /* Perform error checking to make sure input
does */
   if (strlen(bufferptr)<(arraysize)) /* not exceed bounds of inarray.
*/	
     for (index=0;index<strlen(bufferptr);index++)
       inarray[index]=bufferptr[index];   /* If error checking is
passed, */
   else                                   /* then let inarray=buffer.
*/
   {
    puts("\tString to large.");        /* Else print message and
return */
    return(1);                         /* 1 to indicate error to
caller */
   }
 else
 {
  puts("\tError in string storage, exiting...");
  exit(1);  /* If bufferptr=NULL then there has been a fatal error. */
 }


 if ((inarray[0]=='+') || (inarray[0]=='-'))       /* Error checking
for */
   {                                               /* characters
thatare */
                                                   /* not numbers or
a+- */
    if (inarray[0]=='+')
      inarray[0]='0';
    else inarray[0]='1';

     for (index=1; index<strlen(inarray); index++)
      {
        if ((inarray[index]<'0') || (inarray[index]>'9'))
         {
          puts("\tInvalid character in string");
          puts("\tCorrect form is [+/-]xxxxx where x is a digit");
          return(1);  /* If invalid character is found then print
error */
         }            /* message with complete form of input and
return */
       }              /* a one to the calling program. */

   }    /* End of primary if statment. */
 else   /* The number is not signed properly. */
 {
  puts("\tMust put + or - sign on input number!");
  return(1);
 }

 *invalue=ConvertArray(inarray,arraysize); /* Set the value of the
actual */
                              /* parameter pointed to by invalue =
tothe */
                              /* integer value stored in inarray. */


 do    /* Asks user if ouput number is equal to the number the user */
 {  			   /* originally typed in. */
   printf("\n\tIs %d the correct number? ",*invalue);
   response=getchar();
   Kbfflush();
 }
 while(!((char)response=='n' || (char)response=='N' ||
(char)response=='y' ||
	(char)response=='Y'));


 if (((char)response=='y') || ((char)response=='Y'))
	return(0);      /* If user approves of ouput then */
 else return(1);        /* return 0 else return 1 for error. */
  

}


-----------------------------------------------

sdarl AT why DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019