Re: [hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-28 Thread Roberto E. Vargas Caballero
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

Re: [hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-28 Thread Roberto E. Vargas Caballero
Hi, On Sun, Dec 24, 2023 at 11:46:26AM +0100, Rene Kita wrote: > Nit as it's more a matter of style: I'd prefer to have one function to > create a String and another function to create a String from a char > array. This would make a cleaner interface and avoids passing and > dealing with NULL all

Re: [hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-26 Thread Страхиња Радић
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

Re: [hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-24 Thread Rene Kita
Comment inline. On Wed, Dec 13, 2023 at 12:55:27PM +0100, Roberto E. Vargas Caballero wrote: > This makes possible to use the function to initialize the string from > an existing char array. > --- > ed.c | 30 +- > 1 file changed, 21 insertions(+), 9 deletions(-) > >

[hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-13 Thread Roberto E. Vargas Caballero
This makes possible to use the function to initialize the string from an existing char array. --- ed.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ed.c b/ed.c index b430e74..13e956a 100644 --- a/ed.c +++ b/ed.c @@ -122,12 +122,24 @@