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

Re: pdns: FTBFS on hurd-i386 (for review)



Svante Signell, le Wed 25 Jun 2014 13:37:39 +0200, a écrit :
> On Wed, 2014-06-25 at 13:10 +0200, Samuel Thibault wrote:
> > Svante Signell, le Wed 25 Jun 2014 13:01:49 +0200, a écrit :
> > > @@ -483,7 +484,9 @@ bool ArgvMap::file(const char *fname, bo
> > >           if (ent->d_name[0] == '.') continue; // skip any dots
> > >           if (boost::ends_with(ent->d_name, ".conf")) {
> > >              // ensure it's readable file
> > > -            snprintf(namebuf, sizeof namebuf, "%s/%s", params["include-dir"].c_str(), ent->d_name);
> > > +            len = st.st_size + 1 + strlen(ent->d_name) + 1;
> > 
> > Err, did you have a look at what st.st_size was?  For a directory,
> > it'll be the size of the directory listing in bytes, which
> > is completely unrelated to the path. Why not simply using
> > params["include-dir"].length() ?
> 
> Didn't know about that one, not so fluent in C++.

Well, or strlen(params["include-dir"].c_str()), that would work too
(though probably less efficient).

> Updated patch attached

It looks good to me.

Samuel


Reply to: