[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Bug in read( file, "*a" )
- From: Fred Bertsch <fb@...>
- Date: Sat, 17 Jun 2000 18:04:49 -0400 (EDT)
In Lua 4.0 (alpha), there is a bug with the read() function. It creates a
string whose length and contents don't match. (ie: the strings it returns
are shorter than claimed.)
This causes functions like strfind() which read the whole string to crash
For example, I read a 28k file in, and the C library function strlen()
reported about 11k, but the Lua library function strlen() reported about
26k. This was under Windows NT.
Let me know if you need a specific file to read in or a specific piece of
Lua code to read it. I didn't delve all that deeply into the io library,
so it's possible I misdiagnosed the problem.