Commit bc20b643 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

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
parent 74910df0
......@@ -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);
}
}
......
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