Skip to content

nitpick: missing input validation for margin #62

@sanga

Description

@sanga

I fat-fingered the value for margin and got the following.

wmfocus ---halign=center --valign=center --font=Hack:140 --margin=5-    2.007s
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { message: "\u{1b}[1;31merror:\u{1b}[0m Invalid value: The argument \'5-\' isn\'t a valid value", kind: ValueValidation, info: None }', src/utils.rs:221:18
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: __libc_start_main
  13: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The stack is basically pointless, sorry, I just installed this from AUR. Presumably the bug is pretty obvious here however (though I haven't actually looked at the code).

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