Skip to content

Commit 013ce4b

Browse files
committed
Add copyFromCString wrapper for Pointer_stringify
1 parent bb73f36 commit 013ce4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wrapper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ function setupMethods (soljson) {
3535
soljson.setValue(ptr, buffer, '*');
3636
};
3737

38+
var copyFromCString = function (ptr) {
39+
return soljson.Pointer_stringify(ptr);
40+
}
41+
3842
var wrapCallback = function (callback) {
3943
assert(typeof callback === 'function', 'Invalid callback specified.');
4044
return function (path, contents, error) {
41-
var result = callback(soljson.Pointer_stringify(path));
45+
var result = callback(copyFromCString(path));
4246
if (typeof result.contents === 'string') {
4347
copyToCString(result.contents, contents);
4448
}

0 commit comments

Comments
 (0)