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:
parent
2f369ccacf
commit
586fcff061
@ -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: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user