aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmpdclient.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-18 00:59:40 +0200
committerMax Kellermann <max@duempel.org>2008-09-18 00:59:40 +0200
commita88a4249b0f8bc7977dc265fade64f8943b70a19 (patch)
treee56ad3b18afa792b7c10e5251b18f3dbaa8af18d /src/libmpdclient.c
parent76c97b279206dbfb75da9047a62e6fcbe20ad64c (diff)
downloadmpd-a88a4249b0f8bc7977dc265fade64f8943b70a19.tar.gz
mpd-a88a4249b0f8bc7977dc265fade64f8943b70a19.tar.xz
mpd-a88a4249b0f8bc7977dc265fade64f8943b70a19.zip
libmpdclient: use size_t and ssize_t
When working with buffer lengths and recv() results, we should declare size_t and ssize_t variables, otherwise the code may fail on 64 bit machines.
Diffstat (limited to 'src/libmpdclient.c')
-rw-r--r--src/libmpdclient.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libmpdclient.c b/src/libmpdclient.c
index 0733ccad1..675521f3b 100644
--- a/src/libmpdclient.c
+++ b/src/libmpdclient.c
@@ -417,7 +417,7 @@ mpd_Connection * mpd_newConnection(const char * host, int port, float timeout) {
FD_ZERO(&fds);
FD_SET(connection->sock,&fds);
if((err = select(connection->sock+1,&fds,NULL,NULL,&tv)) == 1) {
- int readed;
+ ssize_t readed;
readed = recv(connection->sock,
&(connection->buffer[connection->buflen]),
MPD_BUFFER_MAX_LENGTH-connection->buflen,0);
@@ -540,7 +540,7 @@ static void mpd_getNextReturnElement(mpd_Connection * connection) {
fd_set fds;
struct timeval tv;
char * tok = NULL;
- int readed;
+ ssize_t readed;
char * bufferCheck = NULL;
int err;
int pos;