Skip to content

Commit 1cfd6d7

Browse files
committed
bug fixes
1 parent ae0bcb7 commit 1cfd6d7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-bsdiff",
3-
"version": "0.1.1",
3+
"version": "0.1.3",
44
"description": "bsdiff port to node.js",
55
"main": "index.js",
66
"scripts": {

src/main.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <node_buffer.h>
77

88
#include <memory.h>
9+
#include <stdlib.h>
910

1011
extern "C" {
1112
#include "bsdiff/bsdiff.h"
@@ -120,7 +121,7 @@ namespace bsdiffNode
120121

121122
stream.next_out = bufStart;
122123
stream.avail_out = 4096;
123-
BZ2_bzCompress( &stream, BZ_FINISH);
124+
ret = BZ2_bzCompress( &stream, BZ_FINISH);
124125
}
125126

126127
if (ret != BZ_STREAM_END) {
@@ -132,6 +133,7 @@ namespace bsdiffNode
132133
Local<Value> argv[1] = { obj };
133134
cb->Call(Null(isolate), 1, argv);
134135

136+
BZ2_bzCompressEnd(&stream);
135137
free(bufStart);
136138
}
137139

0 commit comments

Comments
 (0)