Commit 4db89dda authored by Martin Blix Grydeland's avatar Martin Blix Grydeland Committed by Reza Naghibi

Change VTCP_Check() to take a ssize_t

Since the input value is sometimes the result of a read()/write() call,
avoid truncating the ssize_t value on calling it.
parent aafb1325
...@@ -35,7 +35,7 @@ struct suckaddr; ...@@ -35,7 +35,7 @@ struct suckaddr;
#define VTCP_ADDRBUFSIZE 64 #define VTCP_ADDRBUFSIZE 64
#define VTCP_PORTBUFSIZE 16 #define VTCP_PORTBUFSIZE 16
int VTCP_Check(int a); int VTCP_Check(ssize_t a);
#define VTCP_Assert(a) assert(VTCP_Check(a)) #define VTCP_Assert(a) assert(VTCP_Check(a))
struct suckaddr *VTCP_my_suckaddr(int sock); struct suckaddr *VTCP_my_suckaddr(int sock);
......
...@@ -556,7 +556,7 @@ VTCP_check_hup(int sock) ...@@ -556,7 +556,7 @@ VTCP_check_hup(int sock)
*/ */
int int
VTCP_Check(int a) VTCP_Check(ssize_t a)
{ {
if (a == 0) if (a == 0)
return (1); return (1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment