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
This commit is contained in:
parent
74910df0f3
commit
bc20b64302
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user