[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Byte-compiled chunk safe in C string?
- From: "Peter Prade" <Peter.Prade@...>
- Date: Tue, 18 Feb 2003 18:46:44 +0100
> I'm designing a binary file format, and I'd like to be able to
> embed byte-compiled
> Lua chunks in it. I looked in the refman, but I wasn't able to
> find anything on it.
> So, can I store byte-compiled chunks in null-terminated C
> strings? Specifically,
> will there be any stray nulls in a byte-compiled chunk?
No. you can't rely on that. imagine this script:
s = "\0" -- this string as a constant, will be part of the chunk!
Cheers,
Peter
P.S.
Lua strings can contain binary data with 0's in them.