home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:18850 comp.unix.bsd:10611
- Path: sparky!uunet!munnari.oz.au!metro!grivel!alsvid.une.edu.au!mark
- From: mark@alsvid.une.edu.au (Mark Garrett Internet: mark@arvak.une.edu.au Phone: +61 66 20 3859)
- Newsgroups: comp.lang.c,comp.unix.bsd
- Subject: Re: Segmentation faults
- Message-ID: <Bzqv3A.Jpz@alsvid.une.edu.au>
- Date: 24 Dec 92 03:30:45 GMT
- References: <BzGHo4.AK9@fs7.ece.cmu.edu>
- Organization: University of New England - Northern Rivers (Lismore)
- Lines: 33
-
- From article <BzGHo4.AK9@fs7.ece.cmu.edu>, by woyansky@flamingo.ece.cmu.edu (George J. Woyansky):
- >
- > |>
- > |>
- > |> Hi,
- > |> Why is the following code producing a segmentation fault???
- > |> I am compiling this code on an Encore Multimax running UMAX 4.3 Unix.
- > |> Please send replies to CBUSCH@ub.d.umn.edu.
- > |>
- > [OK frags deleted]
- > |>
- > |> void writexy(x,y,s)
- > |> {
- > |> printf("\33[%d;%dH%s",y,x,s);
- > |> }
- > |>
- >
- >
- >
- > Hmm. Maybe here? You need
- > int x,y;
- > char s[];
- >
- > after your function declaration.
-
- That is correct the c compiler will have assumed x , y and s to be
- signed integers, thus incorrectly using s.
-
- Cheers
- Mark :)
- --
- Mark Garrett Internet: mark@arvak.une.edu.au Phone: +61 66 20 3859
- University of New England, Northern Rivers, Lismore NSW Australia.
-