Subject: Re: bug#37756: [PATCH] Wrong initialization of fringe bitmap

From: Carlos Pita <[email-masked]>
Date: Tue, 15 Oct 2019 07:14:25 -0300

> Can you explain your reasoning?  The loop after that does initialize

Ok, TBH I hadn't looked at the loop. But anyway:

> >   xfb = xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW);

This allocates fb.height * BYTES_PER_BITMAP_ROW for bits = b.

> >   memset (b, 0, fb.height);

This only initializes fb.height bytes to zero.

And then the loop indeed initializes all fb.height *
BYTES_PER_BITMAP_ROW bytes (b being an unsigned short pointer):

  j = 0;
  while (j < fb.height)
    {
       ...
       b[j++] = something;
       ...
    }

So instead of memset (b, 0, fb.height) being incomplete I would now
say that it is redundant and misleading.