zero is used to provide aligned line offsets in the tempfile. it does
indeed store integers, f.ex. from putline(), and this is indeed a bug.
however, unless an integer is larger than a pointer, the bug is that
it wastes memory.

change it (and the realloc) to sizeof(*zero) and don't worry about the
type again :)

--dho

On Thu, May 28, 2026 at 4:30 PM <[email protected]> wrote:
>
> To clarify, the code in question deals with the global zero in ed declared as:
>
> int* zero;
>
> and later on it is intialized with
>
> zero = malloc((nlall+5)*sizeof(int*));
>
> I don't see how this is not a bug ... zero is a dynamic array of ints, it 
> should be zero = malloc (<number of elements of dynamic array> * sizeof(int)) 
> not     <number> * sizeof(int*);
>
> 9fans / 9fans / see discussions + participants + delivery options Permalink

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb698c8da65baca8e-M39afd213bc0266b98928bba1
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to