From e1a42f6a4481bc8bc9614e3769b7e4d414f8f4e6 Mon Sep 17 00:00:00 2001 From: Nitin Gupta Date: Sat, 3 Dec 2016 15:17:51 -0800 Subject: [PATCH] Fix new value length in partial_merge_callback --- src/merge_operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/merge_operator.rs b/src/merge_operator.rs index e299cd9..283e71f 100644 --- a/src/merge_operator.rs +++ b/src/merge_operator.rs @@ -119,7 +119,7 @@ pub unsafe extern "C" fn partial_merge_callback(raw_cb: *mut c_void, // TODO(tan) investigate zero-copy techniques to improve performance let buf = libc::malloc(result.len() as size_t); assert!(!buf.is_null()); - *new_value_length = 1 as size_t; + *new_value_length = result.len() as size_t; *success = 1 as u8; ptr::copy(result.as_ptr() as *mut c_void, &mut *buf, result.len()); buf as *mut c_char