Return-Path: X-Original-To: apmail-celix-commits-archive@www.apache.org Delivered-To: apmail-celix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AAB2910F4C for ; Mon, 9 Feb 2015 12:17:35 +0000 (UTC) Received: (qmail 57157 invoked by uid 500); 9 Feb 2015 12:17:35 -0000 Delivered-To: apmail-celix-commits-archive@celix.apache.org Received: (qmail 57135 invoked by uid 500); 9 Feb 2015 12:17:35 -0000 Mailing-List: contact commits-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list commits@celix.apache.org Received: (qmail 57126 invoked by uid 500); 9 Feb 2015 12:17:35 -0000 Delivered-To: apmail-incubator-celix-commits@incubator.apache.org Received: (qmail 57121 invoked by uid 99); 9 Feb 2015 12:17:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2015 12:17:35 +0000 Date: Mon, 9 Feb 2015 12:17:35 +0000 (UTC) From: "Alexander Broekhuis (JIRA)" To: celix-commits@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CELIX-216) Replace strtok with strtok_r MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CELIX-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312164#comment-14312164 ] Alexander Broekhuis commented on CELIX-216: ------------------------------------------- [~sts-danielp] I've pushed a fix for this that should solve CELIX-214 as well. Can you please test? > Replace strtok with strtok_r > ---------------------------- > > Key: CELIX-216 > URL: https://issues.apache.org/jira/browse/CELIX-216 > Project: Celix > Issue Type: Improvement > Reporter: Alexander Broekhuis > Assignee: Alexander Broekhuis > Fix For: next > > > Currently strtok is used in several places. While on a first inspection this is ok in most places, there are several side-effects when a function using strtok is called inside a strtok invocation as well. This is not obvious at first sight, so using strtok is risky at best. > To prevent this strtok should be replaced with strtok_r, which provides an API in which a pointer can be used to keep track of the strtok invocation. > strtok is used in: > * launcher.c:123 main > * discovery > -- endpoint_discovery_poller.c:93 endpointDiscoveryPoller_create > * remote_service_admin_http > -- remote_service_admin_impl.c:394 remoteServiceAdmin_exportService > -- remote_service_admin_impl.c:400 remoteServiceAdmin_exportService > -- remote_service_admin_impl.c:402 remoteServiceAdmin_exportService > * remote_service_admin_shm > -- remote_service_admin_impl.c:487 remoteServiceAdmin_exportService > -- remote_service_admin_impl.c:493 remoteServiceAdmin_exportService > -- remote_service_admin_impl.c:495 remoteServiceAdmin_exportService > * shell > -- help_command.c:65 helpCommand_execute > -- install_command.c:61 installCommand_execute > -- ps_command.c:67 psCommand_execute > -- start_command.c:55 startCommand_execute > -- stop_command.c:56 stopCommand_execute > -- uninstall_command.c:57 uninstallCommand_execute > -- update_command.c:63 updateCommand_execute -- This message was sent by Atlassian JIRA (v6.3.4#6332)