bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [PATCH] Small fix for limited number of strings (and pote


From: Yousong Zhou
Subject: Re: [Bug-wget] [PATCH] Small fix for limited number of strings (and potential garbage value) in arguments to concat_strings
Date: Tue, 21 Oct 2014 16:49:12 +0800

On 21 October 2014 16:17, Pär Karlsson <address@hidden> wrote:
> Yes, you are right, of course. Looking through the original implementation
> again, it seems water tight. clang probably complains about the
> uninitialized values above argcount in saved_lengths[], that are never
> reached.
>
> The precalculated strlen:s saved is likely only an optimization(?) attempt,
> I suppose.

Yes. Grepping through the code shows that currently there is no
invocation of concat_strings() having more than 5 arguments.

>
> Still, it seems wasteful to set up two complete loops with va_arg, and
> considering what this function actually does, I wonder if not s(n)printf
> should be used instead of this function? :-)

I think concat_strings() is more tight and readable than multiple
strlen() + malloc() + snprintf().

Regards.

               yousong



reply via email to

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