Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed/unsigned comparison #27

Open
iphydf opened this issue Sep 6, 2018 · 0 comments
Open

Signed/unsigned comparison #27

iphydf opened this issue Sep 6, 2018 · 0 comments

Comments

@iphydf
Copy link
Contributor

iphydf commented Sep 6, 2018

Probable solution (since the other way around is UB):

diff --git a/src/interface.cpp b/src/interface.cpp
index dba3678..0576553 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -154,6 +154,6 @@ void NetworkInterface::processPacket(const uint8_t* data,
         ret = write(fd, data, size);
 #endif
     }
-    if(ret != size)
+    if((size_t)ret != size)
         cerr << "partial packet write to tun\n";
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant