[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: strcpy HELP!!!!



Phil,

You are copying the string to temp2 which has not been initialized and is a
NULL pointer.  You need to allocate memory of at least the same size as
temp1 to temp2 and
this will solve your problem.

Scott D. Killen
Scott Killen Software
http://www.skillsoft.com

-----Original Message-----
From: witwerg@cypress.idir.net [mailto:witwerg@cypress.idir.net]On
Behalf Of Phil
Sent: Wednesday, April 15, 1998 9:01 PM
To: debian-user@lists.debian.org
Subject: strcpy HELP!!!!


I'm using libc6 2.0.7pre1-4 and strcpy gives me a segmentation
error!
I've attached my C test program for inspection(source only).

I only do a few things.  malloc memory for a variable(forgot a
corresponding free)
copy a string in this varible, copy this string to another
string, print both
on the screen.  The exact error message is attached to the
source.

I will now check bug track.

Thanks in advance

Philip

--
      _
     _ \ \   From Witomatic Keep,
   / \_\ |       Home of Witwerg the Sage
  |  //o_/ | ----------------------------------
    | \ \_/  Weilding GCC and Linux 2.0.33
     \ \_    Tschuss!  Auf Wiedsehen!


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: