<commit_before>use std::ffi::CString;
use libc;

pub fn c_string(s: &str) ->  CString {
    CString::new(s).unwrap()
}

pub fn string(raw: *const libc::c_char) -> String {
    unsafe {
        CString::from_raw(raw as *mut libc::c_char).into_string().unwrap()
    }
}<commit_msg>Fix segfault bug<commit_after>use std::ffi::{CString,CStr};
use libc;

pub fn c_string(s: &str) ->  CString {
    CString::new(s).unwrap()
}

pub fn string(raw: *const libc::c_char) -> String {
    unsafe { CStr::from_ptr(raw).to_str().unwrap().to_owned() }
}
{'fraction_non_alphanumeric': 0.18773234200743494, 'fraction_numerical': 0.0, 'mean_word_length': 4.336633663366337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1587759', 'n_tokens_mistral': 215, 'n_tokens_neox': 212, 'n_words': 41}