This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: tmpnam() core dumping


On Fri, Dec 12, 1997 at 08:13:46AM -0600, Bill Ahlbrandt wrote:
> I am getting a core dump when I use the tmpnam() function.

RTM, you are calling

tmpnam("xxx"),

and tmpnam tries to overwrite the memory you gave to it (which
is a constant string which is in a readonly section), thus
you get a segmentation fault.

      -----==-                                              |
      ----==-- _                                            |
      ---==---(_)__  __ ____  __       Marc Lehmann       +--
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com       |e|
      -=====/_/_//_/\_,_/ /_/\_\                          --+
    The choice of a GNU generation                        |
                                                          |


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]