Re: ssh nits

2023-03-08 Thread Darren Tucker
On Thu, 9 Mar 2023 at 06:50, joshua stein wrote: > On Thu, 09 Mar 2023 at 06:41:50 +1100, Darren Tucker wrote: > > This seems to be one too many parens? ie > > if (negate = (attrib[0] == '!')) > > clang warns if there's not the extra set of parens in case it's an > accidental = instead of ==

Re: ssh nits

2023-03-08 Thread Damien Miller
On Thu, 9 Mar 2023, Darren Tucker wrote: > On Thu, 9 Mar 2023 at 02:09, joshua stein wrote: > > cppcheck found these, are they worth fixing? > > > > In the non-fail case, done is set to NULL and then free()d. > > free(NULL) is legal but maybe worth removing? > > ssh uses this pattern a lot, a

Re: ssh nits

2023-03-08 Thread joshua stein
On Thu, 09 Mar 2023 at 06:41:50 +1100, Darren Tucker wrote: > > + if ((negate = (attrib[0] == '!'))) > > This seems to be one too many parens? ie > if (negate = (attrib[0] == '!')) clang warns if there's not the extra set of parens in case it's an accidental = instead of ==.

Re: ssh nits

2023-03-08 Thread Darren Tucker
On Thu, 9 Mar 2023 at 02:09, joshua stein wrote: > cppcheck found these, are they worth fixing? > > In the non-fail case, done is set to NULL and then free()d. > free(NULL) is legal but maybe worth removing? ssh uses this pattern a lot, and I agree with millert that it's not worth changing. char

Re: ssh nits

2023-03-08 Thread Todd C . Miller
On Wed, 08 Mar 2023 09:02:08 -0600, joshua stein wrote: > In the non-fail case, done is set to NULL and then free()d. > free(NULL) is legal but maybe worth removing? Please leave this as-is. I don't think it is worth appeasing cppcheck in this case. > diff --git usr.bin/ssh/scp.c usr.bin/ssh/

ssh nits

2023-03-08 Thread joshua stein
cppcheck found these, are they worth fixing? In the non-fail case, done is set to NULL and then free()d. free(NULL) is legal but maybe worth removing? diff --git usr.bin/ssh/scp.c usr.bin/ssh/scp.c index f0f09bba623..acb7bd8a8a1 100644 --- usr.bin/ssh/scp.c +++ usr.bin/ssh/scp.c @@ -935,19 +93