Re: can function sftp_upload return OK even if an error message is received?

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Tue, May 20, 2025 at 06:09:25PM +1000, Damien Miller wrote:
Thanks, I'm not 100% sure it can happen but that's alone enough reason
to make it perfectly obvious that it can't.

Speaking of making things perfectly obvious, is it just me who always has to look up the order of precedence of logical operators vs. ternary operators?

-	return status == SSH2_FX_OK ? 0 : -1;
+	return status != SSH2_FX_OK || failed ? -1 : 0;

"||" binds more tightly than "?:", so this should be OK - but I did have to check, so I think some parentheses for clarity might not go amiss here.

Thanks,

--
Colin Watson (he/him)                              [cjwatson@xxxxxxxxxx]
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux