All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] tst_test: Fix test regression on -i
@ 2026-09-21  8:45 Petr Vorel
  2026-09-21  9:16 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2026-09-21  8:45 UTC (permalink / raw)
  To: ltp

50745a2918 correctly changed iterations from int to unsigned int.
But UINT_MAX SAFE_STRTOUL() needs to be used, otherwise simple -i2
fails due UINT_MAX overflowed:

    tst_test.c:836: TBROK: strtol(2): 2 is out of range 0 - -1

Fixes: 50745a2918 ("lib: tst_test: Move the iterations to struct tst_test")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 2b38d0063d..ed3d26cad0 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -833,7 +833,7 @@ static void parse_opts(int argc, char *argv[])
 			print_test_tags();
 			exit(0);
 		case 'i':
-			tst_test->iterations = SAFE_STRTOL(optarg, 0, UINT_MAX);
+			tst_test->iterations = SAFE_STRTOUL(optarg, 0, UINT_MAX);
 		break;
 		case 'I':
 			if (tst_test->runtime > 0)
-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH 1/1] tst_test: Fix test regression on -i
  2026-09-21  8:45 [LTP] [PATCH 1/1] tst_test: Fix test regression on -i Petr Vorel
@ 2026-09-21  9:16 ` Cyril Hrubis
  2026-09-21  9:33   ` Petr Vorel
  0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2026-09-21  9:16 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH 1/1] tst_test: Fix test regression on -i
  2026-09-21  9:16 ` Cyril Hrubis
@ 2026-09-21  9:33   ` Petr Vorel
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2026-09-21  9:33 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

> Hi!
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

Merged, thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-21  9:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21  8:45 [LTP] [PATCH 1/1] tst_test: Fix test regression on -i Petr Vorel
2026-09-21  9:16 ` Cyril Hrubis
2026-09-21  9:33   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.