Thread

  1. Re: [HACKERS] What is nameout() for?

    Bruce Momjian <maillist@candle.pha.pa.us> — 1999-11-07T20:48:09Z

    > Actually, I have 'C' question regarding the above code. Where does the
    > "-" live in RAM? Does the compiler generated a data hunk such that this
    > string will be apart of the final executable and each invocation of this
    > routine would result in a pointer to that 'global' location being
    > returned? 
    > Or does it allocate the memory for, and initialize, the "-" on the stack? 
    > If so, isn't returning a "-" a dangerous act?
    > 
    > In fact, isn't returning a "-" dangerous either way without the 
    > protoype being:
    
    One copy, usually in the text segment because it is ready-only.
    
    
    -- 
      Bruce Momjian                        |  http://www.op.net/~candle
      maillist@candle.pha.pa.us            |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026