From daee34477a87f7eb97aa537577a48ddcf5a7d30b Mon Sep 17 00:00:00 2001 From: NRK Date: Wed, 14 Sep 2022 06:58:41 +0200 Subject: fix potential truncation of cli arguments (#367) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit strtol() returns a `long`, but we're storing the result in an `int` which might end up getting truncated. change `n` to `long` and guard against >INT_MAX arguments in cases where it matters. use a float for storing argument of `-S` change `opt.slideshow` to `unsigned` similar to `img.ss.delay` Co-authored-by: Berke Kocaoğlu Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/367 Reviewed-by: Berke Kocaoğlu Reviewed-by: explosion-mental --- nsxiv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nsxiv.h') diff --git a/nsxiv.h b/nsxiv.h index 2dc1783..7bf7e25 100644 --- a/nsxiv.h +++ b/nsxiv.h @@ -239,7 +239,7 @@ struct opt { bool animate; bool anti_alias; int gamma; - int slideshow; + unsigned int slideshow; int framerate; /* window: */ -- cgit v1.2.3-70-g09d2