lua-users home
lua-l archive

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


On Tue, 4 Aug 2009 14:53:52 +0100
Rob Kendrick <lua-l@nun.org.uk> wrote:

> On Tue, 4 Aug 2009 15:46:42 +0200
> steve donovan <steve.j.donovan@gmail.com> wrote:
> 
> > On Tue, Aug 4, 2009 at 3:44 PM, Luiz Henrique de
> > Figueiredo<lhf@tecgraf.puc-rio.br> wrote:
> > > And the strcpy helped??
> > >
> > 
> > Oh yes, then it was a well-behaved string. A mystery to me also.
> 
> Valgrind to the rescue.
> 
> B.

Okay, as the output from my previous mail would suggest, the problem
wasn't that the string wasn't null-terminated; rather, it was that the
string was a little too null-terminated.  Since print uses the C-side
printf facility, it saw this string:

foo\0\0\0\0...was created or renamed

And only printed until the first NULL.  My solution was simple: use
lua_pushstring instead.  Linux filenames can't have NULL in them
anyway, right?

Updates have been pushed to GitHub.

-Rob

Attachment: signature.asc
Description: PGP signature