Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-18 Thread Hiltjo Posthuma
On Fri, Mar 18, 2022 at 02:11:27PM +0600, NRK wrote: > On Fri, Mar 18, 2022 at 12:40:00AM +0100, Roberto E. Vargas Caballero wrote: > > Uh, I didn't realize about it, I just saw that having 255 entries was > > wrong ^^!!!. > > I think the best approach is to split the commit in two and

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-18 Thread NRK
On Fri, Mar 18, 2022 at 12:40:00AM +0100, Roberto E. Vargas Caballero wrote: > Uh, I didn't realize about it, I just saw that having 255 entries was > wrong ^^!!!. > I think the best approach is to split the commit in two and evaluate/review > them isolated; one commit to fix the size, and

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread Roberto E. Vargas Caballero
Hi, On Fri, Mar 18, 2022 at 03:16:56AM +0600, NRK wrote: > But yes, you're right, you'd need 256 elements to be able to index into > an array as any unsigned char. So maybe it *should* be 256. Uh, I didn't realize about it, I just saw that having 255 entries was wrong ^^!!!. I think the

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread NRK
On Thu, Mar 17, 2022 at 09:44:35PM +0100, Roberto E. Vargas Caballero wrote: > I meant 256. If you want to be able to use any unsigned char as index > in the array then you need 256 positions, from 0 to 255. The patch > also had that wrong. > > Also, the comment of the patch only stayed that it

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread NRK
On Thu, Mar 17, 2022 at 08:25:09PM +0100, Roberto E. Vargas Caballero wrote: > On Tue, Mar 15, 2022 at 04:30:52PM +0600, NRK wrote: > > +static const char base64_digits[(unsigned char)-1] = { > > Any reason to write "(unsigned char)-1" instead of writing 256? Didn't hardcode 255 for pedantic

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread Laslo Hunhold
On Thu, 17 Mar 2022 20:25:09 +0100 "Roberto E. Vargas Caballero" wrote: Dear Roberto, > On Tue, Mar 15, 2022 at 04:30:52PM +0600, NRK wrote: > > +static const char base64_digits[(unsigned char)-1] = { > > Any reason to write "(unsigned char)-1" instead of writing 256? char is not guaranteed

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread Roberto E. Vargas Caballero
Hi, On Tue, Mar 15, 2022 at 04:30:52PM +0600, NRK wrote: > +static const char base64_digits[(unsigned char)-1] = { Any reason to write "(unsigned char)-1" instead of writing 256? Regards,