From 61d8827012b027975cd5edb9d0eb877c7ca749eb Mon Sep 17 00:00:00 2001
From: Mladen Ivkovic <mladen.ivkovic@hotmail.com>
Date: Wed, 29 Nov 2023 12:57:38 +0000
Subject: [PATCH] added check for valid thread number provided

---
 swift.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/swift.c b/swift.c
index 4507ac055c..8c54e51d1e 100644
--- a/swift.c
+++ b/swift.c
@@ -411,6 +411,8 @@ int main(int argc, char *argv[]) {
   }
 
   /* Deal with thread numbers */
+  if (nr_threads <= 0)
+    error("Invalid number of threads provided (%d), must be > 0.", nr_threads);
   if (nr_pool_threads == -1) nr_pool_threads = nr_threads;
 
   /* Write output parameter file */
-- 
GitLab