diff options
author | Takayuki MATSUOKA <takayuki.matsuoka@gmail.com> | 2015-04-13 11:16:37 (GMT) |
---|---|---|
committer | Takayuki MATSUOKA <takayuki.matsuoka@gmail.com> | 2015-04-13 11:16:37 (GMT) |
commit | fd77bad52f39106dc1af40405076581426e86877 (patch) | |
tree | 3589293db16c204eed17df70e9f72f5790edde99 /examples/blockStreaming_lineByLine.c | |
parent | b036eaade6bccc6a2358d22c874acff062762900 (diff) | |
download | lz4-fd77bad52f39106dc1af40405076581426e86877.zip lz4-fd77bad52f39106dc1af40405076581426e86877.tar.gz lz4-fd77bad52f39106dc1af40405076581426e86877.tar.bz2 |
Replace obsolete functions
Diffstat (limited to 'examples/blockStreaming_lineByLine.c')
-rw-r--r-- | examples/blockStreaming_lineByLine.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/blockStreaming_lineByLine.c b/examples/blockStreaming_lineByLine.c index f0f7d46..8ae268f 100644 --- a/examples/blockStreaming_lineByLine.c +++ b/examples/blockStreaming_lineByLine.c @@ -41,7 +41,8 @@ static void test_compress( size_t ringBufferBytes) { LZ4_stream_t* const lz4Stream = LZ4_createStream(); - char* const cmpBuf = malloc(LZ4_COMPRESSBOUND(messageMaxBytes)); + const size_t cmpBufBytes = LZ4_COMPRESSBOUND(messageMaxBytes); + char* const cmpBuf = malloc(cmpBufBytes); char* const inpBuf = malloc(ringBufferBytes); int inpOffset = 0; @@ -63,8 +64,8 @@ static void test_compress( #endif { - const int cmpBytes = LZ4_compress_continue( - lz4Stream, inpPtr, cmpBuf, inpBytes); + const int cmpBytes = LZ4_compress_safe_continue( + lz4Stream, inpPtr, cmpBuf, inpBytes, cmpBufBytes); if (cmpBytes <= 0) break; write_uint16(outFp, (uint16_t) cmpBytes); write_bin(outFp, cmpBuf, cmpBytes); |