wget-dev
[Top][All Lists]
Advanced

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

Re: wget2 | Draft: Small fixes (!505)


From: @rockdaboot
Subject: Re: wget2 | Draft: Small fixes (!505)
Date: Sat, 28 May 2022 17:11:56 +0000



Tim Rühsen started a new discussion on unit-tests/test.c: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_963270849

>                                       }
>  
>                                       for (it = 0; it < sizeof(string); it++) 
> {
> -                                             memset(string, 'a', it);
> -                                             string[it] = 0;
> +                                             if (it > 0)

This is no the same as before. Since this loop is executed many times, all 
initial 0 bytes have been overwritten after the first time we hit the loop.

You could fix this by `memset(string, 0, sizeof(string))` directly before the 
loop. It is slightly more efficient, but maybe also slightly harder to read !?

I leave the decision to you whether we keep the code as is or use a fixed 
versions of yours :-) I am fine with both.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_963270849
You're receiving this email because of your account on gitlab.com.




reply via email to

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