commit d7b8f6f0aab55828704fd49c39310d0948627f55
parent 11a9a7c7da2077e0ef66bcd0fb8aff3088c4767c
Author: Sébastien Marie <semarie@online.fr>
Date: Tue, 18 Jul 2023 09:18:24 +0000
!latest: safety check for negative N
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.go b/main.go
@@ -302,7 +302,7 @@ func main() {
}
// n == number of news to show
n, err := strconv.Atoi(args[1])
- if err != nil {
+ if err != nil || n <= 0 {
c.Cmd.Message(dest, "conversion error")
time.Sleep(viper.GetDuration("irc.delay"))
return