From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tycho Andersen Subject: [PATCH 2/3] auparse: remove use of rawmemchr Date: Mon, 13 Mar 2017 17:14:33 -0700 Message-ID: <20170314001434.8082-3-tycho@docker.com> References: <20170314001434.8082-1-tycho@docker.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CB462D655 for ; Tue, 14 Mar 2017 00:14:52 +0000 (UTC) Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8314961D19 for ; Tue, 14 Mar 2017 00:14:51 +0000 (UTC) Received: by mail-pg0-f51.google.com with SMTP id b129so73403566pgc.2 for ; Mon, 13 Mar 2017 17:14:50 -0700 (PDT) In-Reply-To: <20170314001434.8082-1-tycho@docker.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com Cc: Tycho Andersen List-Id: linux-audit@redhat.com just iterate over the string instead, it's much simpler and doesn't use a glibc extension. Signed-off-by: Tycho Andersen --- 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.9.3