Skip to content

Commit 586fcff

Browse files
authored
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: #48589 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 2f369cc commit 586fcff

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)