This tiny C program produces a seg fault on slackware64 13.1
this is on slackware64 13.1 running with an amd processor 4gig mem.............
#include <stdio.h>
#define IN 1 /* in a word */
#define OUT 0 /* out of a word */
/* copyright 2011 The Cavater. . . . Master of all C Elements
program prints its input one word per line */
main()
{
char c;
int state;
state = OUT;
while ((c = getchar()) != 'x') {
if (c == ' ' || c == '\t' || c == '\n')
state = OUT;
else if (state == OUT)
state = IN;
if (state == IN)
printf("%s", c);
}
}
|