public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] verify_caps_exec: Replace index() with strchr()
@ 2018-06-24 20:34 Alistair Strachan
  2018-07-03  9:10 ` Petr Vorel
  0 siblings, 1 reply; 6+ messages in thread
From: Alistair Strachan @ 2018-06-24 20:34 UTC (permalink / raw)
  To: ltp

The index() function was removed in POSIX.2008. It is not implemented by
Android's bionic C library for 64-bit platforms.

Use the more portable strchr() function from C89.

Signed-off-by: Alistair Strachan <astrachan@google.com>
---
 testcases/kernel/security/filecaps/verify_caps_exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/security/filecaps/verify_caps_exec.c b/testcases/kernel/security/filecaps/verify_caps_exec.c
index 2c5cc0b2a..7183d8b4a 100644
--- a/testcases/kernel/security/filecaps/verify_caps_exec.c
+++ b/testcases/kernel/security/filecaps/verify_caps_exec.c
@@ -186,7 +186,7 @@ static int fork_drop_and_exec(int keepperms, cap_t expected_caps)
 				 "got a bad seqno (c=%d, s=%d, seqno=%d)", c, s,
 				 seqno);
 		}
-		p = index(buf, '.');
+		p = strchr(buf, '.');
 		if (!p)
 			tst_brkm(TFAIL, NULL,
 				 "got a bad message from print_caps\n");

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

end of thread, other threads:[~2018-07-23 12:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-24 20:34 [LTP] [PATCH] verify_caps_exec: Replace index() with strchr() Alistair Strachan
2018-07-03  9:10 ` Petr Vorel
2018-07-11 16:49   ` [LTP] [PATCH] cpuset_lib: " Alistair Strachan
2018-07-11 16:49     ` [LTP] [PATCH] pounder21: Replace {r,}index() with str{r,}chr() Alistair Strachan
2018-07-23 12:06       ` Petr Vorel
2018-07-23 11:54     ` [LTP] [PATCH] cpuset_lib: Replace index() with strchr() Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox