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

Re: appstream-glib: FTBFS on hurd-i396 (for review)

On Wed, 2014-10-22 at 11:11 +0200, Pino Toscano wrote:
> On 2014-10-22 10:59, Svante Signell wrote:

> >
> > Updated patch attached. For the first part of the patch, I don't find
> > using g_strdup_printf() is an advantage over g_malloc(), since later 
> > on
> > g_realloc() is needed.
> The other option is to just use a different buffer for each path, which
> could actually simplify the code (you are also not checking whether a
> new length is smaller than the previous one, to avoid realloc).

Yes, that could be a solution too, Samuel?

No, I don't check for a smaller length before g_realloc, is that really
needed if so?

> >> also, use g_free instead of free.
> >
> > This was a typo, see the rest of the patch.
> There's still one free left in your patch.

Thanks, fixed

> Also, the following change seems unneeded:
> -		if (archive_entry_pathname (entry) == NULL)
> +		pathname = archive_entry_pathname (entry);
> +		if (pathname == NULL)

pathname is used later on, this simplifies the code. Additionally
continue is the next statement after the check if pathname is NULL so
that strlen (NULL) does not happen. What did you mean here?

> Note that «strlen(tmp)» should be «strlen (tmp)», per coding style
> there.

Typos again, fixed thanks.

Reply to: