Skip to content

typing in non-utf8 causes panic #10

Open
@cmsd2

Description

@cmsd2

this is on the new linenoise-ng code:

tried typing in some non-utf8 garbage.
predictably it panics at
let cast = str::from_utf8(CStr::from_ptr(ptr).to_bytes()).unwrap().to_string();
around src/lib.rs:79

not sure what the correct response is. print the error and return None?
change the signature to return a Result<Option> ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions