summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Linehan <patientulysses@gmail.com>2012-06-15 10:52:32 -0400
committerJason Linehan <patientulysses@gmail.com>2012-06-15 10:52:32 -0400
commitcc247fba3481bdfe852cd6c8f9f5bca6c7bd1987 (patch)
tree87ed1577fb38ae18274f6ff4a5d31877783ad977
parent37f09e2202766c3292a784eec5d6280f34660385 (diff)
downloadcloth-cc247fba3481bdfe852cd6c8f9f5bca6c7bd1987.tar.gz
cloth-cc247fba3481bdfe852cd6c8f9f5bca6c7bd1987.tar.bz2
cloth-cc247fba3481bdfe852cd6c8f9f5bca6c7bd1987.zip
Appropriate types for port number conversion
-rw-r--r--cloth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloth.c b/cloth.c
index ce87185..1bb742c 100644
--- a/cloth.c
+++ b/cloth.c
@@ -171,7 +171,7 @@ void procinfo(pid_t pid, int socket, int hit, struct sockaddr_in *client)
{
char buf[BUFSIZE];
char *ip;
- short port;
+ uint16_t port;
int fd;
time_t t;
@@ -184,7 +184,7 @@ void procinfo(pid_t pid, int socket, int hit, struct sockaddr_in *client)
/*getnameinfo(client, sizeof(*client), host, hostlen, serv, servlen, 0);*/
- sprintf(buf, "%lld:%d:%d:%d:%s:%hd", (long long)t, pid, socket, hit, ip, port);
+ sprintf(buf, "%lld:%d:%d:%d:%s:%hu", (long long)t, pid, socket, hit, ip, port);
/* Write the procinfo to the log file */
if ((fd = open(INFO_PATH, O_CREAT| O_WRONLY | O_APPEND, 0644)) >= 0) {