On Sat, Mar 21, 1998 at 02:04:29AM -0500, Saad wrote:
> I'm experiencing a problem with a C program. I am allocating two nodes
> dynamically and creating a linked list. The problem is when I return from
> the function, it gives me a segmentation fault. My code looks fine, and
> it runs fine und
This code even runs fine under DOS compiled /w BC++4.52...
can't see any problems
-Original Message-
From: Saad <[EMAIL PROTECTED]>
To: RedHat Mailing List <[EMAIL PROTECTED]>
Date: Saturday, March 21, 1998 9:05 AM
Subject: weird Linux+GCC problem
>I'm experi
On Sat, 21 Mar 1998, David E. Fox wrote:
> > The second argument to scanf in the line
> >
> > scanf("%s", &filename);
> >
> > needs to be a pointer to a char ARRAY large enough to hold the input. The
> > way it is, you are overwriting memory. The fact that is works on digital
> > unix is j
> The second argument to scanf in the line
>
> scanf("%s", &filename);
>
> needs to be a pointer to a char ARRAY large enough to hold the input. The
> way it is, you are overwriting memory. The fact that is works on digital
> unix is just a fluke.
Not only that, if filename is defined as a
Umm, the problem is not with Linux or gcc, it's an error in your code.
The second argument to scanf in the line
scanf("%s", &filename);
needs to be a pointer to a char ARRAY large enough to hold the input. The
way it is, you are overwriting memory. The fact that is works on digital
unix is
I'm experiencing a problem with a C program. I am allocating two nodes
dynamically and creating a linked list. The problem is when I return from
the function, it gives me a segmentation fault. My code looks fine, and
it runs fine under digital unix. Do I have to do something different with
lin