aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:21:22 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:21:22 +0000
commit1308290c0ddcc19b0759d05e2b07be6d08147e7d (patch)
treeb5e6f8a2baf1f90d77789d17d3df158c7bde5e5a /src
parentbc7e60cbcd1c7eb9f0dc315b3122498d7aa1ab75 (diff)
downloadmpd-1308290c0ddcc19b0759d05e2b07be6d08147e7d.tar.gz
mpd-1308290c0ddcc19b0759d05e2b07be6d08147e7d.tar.xz
mpd-1308290c0ddcc19b0759d05e2b07be6d08147e7d.zip
yet another migration to size_t
We can also get rid of one the two variables. git-svn-id: https://svn.musicpd.org/mpd/trunk@7341 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/outputBuffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index 9d77caf3a..daf03d4b0 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -204,8 +204,7 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
size_t dataInLen, float data_time, mpd_uint16 bitRate,
ReplayGainInfo * replayGainInfo)
{
- mpd_uint16 dataToSend;
- mpd_uint16 chunkLeft;
+ size_t dataToSend;
char *data;
size_t datalen;
static char *convBuffer;
@@ -244,8 +243,9 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
chunk = outputBufferGetChunk(cb, chunk_index);
- chunkLeft = sizeof(chunk->data) - chunk->chunkSize;
- dataToSend = datalen > chunkLeft ? chunkLeft : datalen;
+ dataToSend = sizeof(chunk->data) - chunk->chunkSize;
+ if (dataToSend > datalen)
+ dataToSend = datalen;
memcpy(chunk->data + chunk->chunkSize, data, dataToSend);
chunk->chunkSize += dataToSend;