Skip to content

Commit f8e484d

Browse files
VoltrexKeyvaCeres6
authored andcommitted
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: nodejs#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>
1 parent fcd2bf2 commit f8e484d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/quic/session.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ uint64_t Session::SendDatagram(Store&& data) {
792792
1,
793793
uv_hrtime());
794794

795-
if (nwrite < 0) {
795+
if (nwrite < 1) {
796796
// Nothing was written to the packet.
797797
switch (nwrite) {
798798
case 0: {

0 commit comments

Comments
 (0)