Newbie problem: Address out of bounds

Eljay Love-Jensen eljay@adobe.com
Fri Sep 19 02:32:00 GMT 2003


Hi Andre,

Does getLine '\0' terminate the line?

Does getLine assure that not to overrun the theLine's buffer size, including the terminator?  (And, if so, how does getLine know how big theLine's buffer is?)

The bzero function is rather non-portable, as it is not a required part of ANSI or System V.  (I think that harkens back to the days of BCPL.)  A portable alternative is memset(ptr, 0x00, 256); instead.

HTH,
--Eljay




More information about the Gcc-help mailing list