Skip to content
This repository was archived by the owner on Jul 11, 2021. It is now read-only.

Commit 4568c1f

Browse files
committed
#50, fix issue, remove trailing NULL chars if present
1 parent 197e498 commit 4568c1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redisql_lib/src/redis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ pub unsafe fn string_ptr_len(
446446
rm::ffi::RedisModule_StringPtrLen.unwrap()(str, &mut len)
447447
as *mut u8;
448448
let slice = slice::from_raw_parts(base, len);
449-
str::from_utf8_unchecked(slice)
449+
str::from_utf8_unchecked(slice).trim_end_matches(char::from(0))
450450
}
451451

452452
#[repr(C)]

0 commit comments

Comments
 (0)