delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/25/16:13:24

From: ripter01 AT aol DOT com (Ripter01)
Newsgroups: comp.os.msdos.djgpp
Subject: Help Please
Lines: 42
NNTP-Posting-Host: ladder07.news.aol.com
X-Admin: news AT aol DOT com
Date: 25 Mar 2000 18:36:10 GMT
Organization: AOL http://www.aol.com
Message-ID: <20000325133610.00647.00003156@ng-cl1.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have this strange (strange to me) problem with one of my C programs
the frist time I run it It works just as I want it to, but anytime after that
it prints a bunch of junk on the screen like:

Exiting to due to signal SIGSEGV
General Production Fault at eip=00002ff3

and then a bunch of stuff that looks like Asm resters and stuff
If I reboot, then I can run the program once without this happaning but then it
happans again, i don't get it, Please help, Here is my code

/* Pad.c */

#include <stdio.h>
#include <string.h>

main()
{
 char Text[20][81], CharTemp;
 int Count,Counter,Temp, i;

 for( i = 0; i <=20; i++)
  strcpy(Text[i], "");

 puts("This will \"pad\" your lines");
 puts("Type quit on a newline to exit");

 do
 {
  Count++;
  printf(">");
  gets(Text[Count]);
 } while( strcmp("quit",Text[Count]) != 0 );

 for( Counter = 0; Counter <= Count; Counter++ )
  if( strlen(Text[Counter]) < 70)
    for( Temp = strlen( Text[Counter] ); Temp <= 70; Temp++ )
     strcat(Text[Counter],".");

 for( Counter = 0; Counter <= 20; Counter++ )
  printf("\n%s",Text[Counter]);
}

- Raw text -


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