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

From: NRK <nrk_AT_disroot.org>
Date: Fri, 18 Mar 2022 01:53:56 +0600

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 reasons (since char is guranteed to be
at least, but not exactly 8bits), and didn't use UCHAR_MAX to avoid
needlessly including <limits.h>.

But given POSIX mandates 8bit chars, hardcoding 255 shouldn't be a
problem in practice.

- NRK
Received on Thu Mar 17 2022 - 20:53:56 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 17 2022 - 21:00:39 CET