libtool
[Top][All Lists]
Advanced

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

Re: BUG in ltdl.c - here's a PATCH


From: Albert Chin
Subject: Re: BUG in ltdl.c - here's a PATCH
Date: Fri, 14 Jun 2002 12:36:18 -0500
User-agent: Mutt/1.2.5i

On Fri, Jun 14, 2002 at 07:49:47PM +0200, Lutz Müller wrote:
> On Fri, 2002-06-14 at 18:23, Albert Chin wrote:
> > Shouldn't we find out why filename is non-zero terminated?
> 
> No, you didn't get it. If you do
> 
> strncpy (filename, dir_name, strlen (dir_name));
> 
> filename will afterwards not be terminated by '\0' (unless filename has
> previously been initialized to 0, for example by memset (filename, 0,
> ...)). If you copy a string, you need to copy the terminating '\0', too,
> i.e. 
> 
> strncpy (filename, dir_name, strlen (dir_name) + 1);

Ok, get it now. Thanks.

-- 
albert chin (address@hidden)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]