Hi, On Tue, Dec 26, 2023 at 03:40:36PM +0100, Страхиња Радић wrote: > On 23/12/24 11:46AM, Rene Kita wrote: > > > + if (!from) { > > > + len = 0; > > > + t = NULL; > > > + } else { > > This seems redundant. Normally, NULL shouldn't be passed, and even if it is, > it > is the responsibility of the "user-programmer" (think libc functions). This > is > further backed by the standard pattern of always checking for failed malloc.
As Rene commented maybe is better to split this function in two different functions. Assigning NULL in this case was needed because it was used later in a call to realloc. Ed is different to other sbase programs where is acceptable to abort when we run out of memory, because it is mainly used in an interactive way and discarding all the changes from the user in that case seems a bit weird. Regards,