diff options
author | Max Kellermann <max@duempel.org> | 2008-04-12 04:13:30 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-04-12 04:13:30 +0000 |
commit | bc20b6430218b62da9e9146fc07940eb3191d6fd (patch) | |
tree | 5b395b3e54b6debf10a673ce0c528ddd1a460160 /src/outputBuffer.c | |
parent | 74910df0f367143e73e460524b31bacead953b16 (diff) | |
download | mpd-bc20b6430218b62da9e9146fc07940eb3191d6fd.tar.gz mpd-bc20b6430218b62da9e9146fc07940eb3191d6fd.tar.xz mpd-bc20b6430218b62da9e9146fc07940eb3191d6fd.zip |
use sizeof(chunk.data) instead of CHUNK_SIZE
sizeof() is the more "natural" or "direct" access to the buffer size,
instead of a macro happening to be used to the buffer declaration.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7270 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/outputBuffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index ad584c8c8..48e9598f6 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -188,7 +188,7 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, chunk = outputBufferGetChunk(cb, chunk_index); - chunkLeft = CHUNK_SIZE - chunk->chunkSize; + chunkLeft = sizeof(chunk->data) - chunk->chunkSize; dataToSend = datalen > chunkLeft ? chunkLeft : datalen; memcpy(chunk->data + chunk->chunkSize, data, dataToSend); @@ -196,7 +196,7 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, datalen -= dataToSend; data += dataToSend; - if (chunk->chunkSize == CHUNK_SIZE) { + if (chunk->chunkSize == sizeof(chunk->data)) { flushOutputBuffer(cb); } } |