File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,11 @@ where
194194{
195195 let file_path = file_path. as_ref ( ) . to_cstr ( ) ;
196196 let options_or_default = if let Some ( opt) = options {
197- opt. get_json_string ( ) . ok ( ) ?. to_cstr ( ) . to_bytes ( ) . to_vec ( )
197+ opt. get_json_string ( )
198+ . ok ( ) ?
199+ . to_cstr ( )
200+ . to_bytes_with_nul ( )
201+ . to_vec ( )
198202 } else {
199203 Metadata :: new_of_type ( MetadataType :: KeyValueDataType )
200204 . get_json_string ( )
@@ -242,7 +246,11 @@ where
242246 P : ProgressCallback ,
243247{
244248 let options_or_default = if let Some ( opt) = options {
245- opt. get_json_string ( ) . ok ( ) ?. to_cstr ( ) . to_bytes ( ) . to_vec ( )
249+ opt. get_json_string ( )
250+ . ok ( ) ?
251+ . to_cstr ( )
252+ . to_bytes_with_nul ( )
253+ . to_vec ( )
246254 } else {
247255 Metadata :: new_of_type ( MetadataType :: KeyValueDataType )
248256 . get_json_string ( )
You can’t perform that action at this time.
0 commit comments