lua-users home
lua-l archive

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


On Thu, 24 Feb 2005 17:07:52 -0300, Alex Sandro Queiroz e Silva >    
The address of the string would be meaningless after the return of
> this function, wouldn't it?

I don't think so. The literal "some string" in C code must be treated
as a constant char array with a valid address. The compiler will
usually save it somewhere with a well defined memory space. But it
should not be changed in general. Or you risk seeing other contents
when passing through it again, besides the possible buffer overflow
hazzards if the original length is not respected when it is modified.

Regards,
Adriano.