aboutsummaryrefslogtreecommitdiffstats
path: root/testing/audit/0002-auparse-remove-use-of-rawmemchr.patch
blob: de774b3a8ed7eeb77503baac15829823b6ab4cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From d28763047fd0937a4f150402d2760b3ddcd3a651 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho@docker.com>
Date: Mon, 13 Mar 2017 16:17:10 -0700
Subject: [PATCH 2/3] auparse: remove use of rawmemchr

just iterate over the string instead, it's much simpler and doesn't use a
glibc extension.

Signed-off-by: Tycho Andersen <tycho@docker.com>
---
 auparse/interpret.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/auparse/interpret.c b/auparse/interpret.c
index 1f517d7..57da00c 100644
--- a/auparse/interpret.c
+++ b/auparse/interpret.c
@@ -803,10 +803,9 @@ static const char *print_proctitle(const char *val)
 		size_t len = strlen(val) / 2;
 		const char *end = out + len;
 		char *ptr = out;
-		while ((ptr  = rawmemchr(ptr, '\0'))) {
-			if (ptr >= end)
-				break;
-			*ptr = ' ';
+		while (ptr < end) {
+			if (*ptr == '\0')
+				*ptr = ' ';
 			ptr++;
 		}
 	}
-- 
2.11.1