Skip to content

Commit a331f3c

Browse files
committed
relax the cimbare_encode() bufize check to allow multiples of chunk size
There's no reason not to allow this, and it gives us more flexibility (ex: maybe the caller wants 128k buffers instead of 16k)
1 parent ca25c24 commit a331f3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/cimbar_js/cimbar_js.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int cimbare_encode(const unsigned char* buffer, unsigned size)
178178
if (!_comp->write(reinterpret_cast<const char*>(buffer), size))
179179
return -2;
180180
}
181-
if (size == cimbare_encode_bufsize())
181+
if (size%cimbare_encode_bufsize() == 0 and size != 0)
182182
return 1; // more to do
183183

184184
// otherwise, we're ready

0 commit comments

Comments
 (0)