Skip to content

[BUG] cursive exits immediately when asked to display a string with a null byte #780

@janstarke

Description

@janstarke

Describe the bug

cursive programs exit immediately when asked to display a string with a null byte. No error message is shown, and there doesn't seem to be a panic

To Reproduce

MWE:
This program should display a TextView, but instead it exists without any complaint.

use cursive::{views::TextView, Cursive, CursiveExt};

fn main() {
    let mut app = Cursive::new();
    app.add_layer(TextView::new("Hello Nullbyte: \0"));
    app.add_global_callback('q', |a| a.quit());
    app.run();
}

Expected behavior
This program should display a TextView, or at least panic with an error message, so that users of cursive know that null bytes are not allowed

Screenshots
no screenshot available

Environment

  • Ubuntu Linux
  • Backend used: ncurses (the default one)
  • de_DE.UTF-8
  • 0.20.0

Additional context
I found this while fixing janstarke/regview#8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions