rustne-kretser / noline

IO-agnostic line editor for embedded systems
Mozilla Public License 2.0
96 stars 9 forks source link

History subtract with overflow #20

Closed m-mueller678 closed 4 months ago

m-mueller678 commented 9 months ago

Hitting up, then down (back and forward in history) on a new editor causes a subtract with overflow panic.

eivindbergem commented 4 months ago

Can confirm:

$ cargo run --bin std-sync                                                                                                                                                                                                                           09:01:27
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/std-sync`
> thread 'main' panicked at /home/eivind.bergem/projects/noline/noline/src/history.rs:363:23:
                                                                                             attempt to subtract with overflow
                                                                                                                              note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace