src: fix logically dead code reported by Coverity

Value of the `nwrite` variable will always be less than 0 when it
reaches the `switch` statement because of the previous check, which
causes `case 0` to never be executed, change the check to allow 0 or
less.

PR-URL: https://github.com/nodejs/node/pull/48589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Mohammed Keyvanzadeh 2023-07-04 10:27:45 +03:30 committed by GitHub
parent 2f369ccacf
commit 586fcff061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -792,7 +792,7 @@ uint64_t Session::SendDatagram(Store&& data) {
1,
uv_hrtime());
if (nwrite < 0) {
if (nwrite < 1) {
// Nothing was written to the packet.
switch (nwrite) {
case 0: {