aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/external.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2010-02-11 13:30:32 +0000
committerErlang/OTP <[email protected]>2010-02-11 13:30:32 +0000
commit2a96208cb00220f963e723ae0530492c5c70df27 (patch)
tree1a0150d8a404a19fa69da48bb49fad95e701454c /erts/emulator/beam/external.c
parent94a5a2832200fa5061d31e64c0eb8315c3215e0a (diff)
downloadotp-2a96208cb00220f963e723ae0530492c5c70df27.tar.gz
otp-2a96208cb00220f963e723ae0530492c5c70df27.tar.bz2
otp-2a96208cb00220f963e723ae0530492c5c70df27.zip
OTP-8335 Even more NIF features
Diffstat (limited to 'erts/emulator/beam/external.c')
-rw-r--r--erts/emulator/beam/external.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index b011d4c0de..099eddd195 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -1027,11 +1027,12 @@ static uLongf binary2term_uncomp_size(byte* data, Sint size)
err = inflateInit(&stream);
if (err == Z_OK) {
- while ((err = inflate(&stream, Z_NO_FLUSH)) == Z_OK) {
- uncomp_size += chunk_size - stream.avail_out;
+ do {
stream.next_out = tmp_buf;
- stream.avail_out = chunk_size;
- }
+ stream.avail_out = chunk_size;
+ err = inflate(&stream, Z_NO_FLUSH);
+ uncomp_size += chunk_size - stream.avail_out;
+ }while (err == Z_OK);
inflateEnd(&stream);
}
erts_free(ERTS_ALC_T_TMP, tmp_buf);