From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BF1FEA00E6 for ; Thu, 16 May 2019 18:37:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 93A045B12; Thu, 16 May 2019 18:37:05 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 2C84C11C5 for ; Thu, 16 May 2019 18:37:04 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id z16so1813896pgv.11 for ; Thu, 16 May 2019 09:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IJeZom9qkXzqxPwuKnHxqdwronErtapgs4T9aydrlvU=; b=fc1DI7xTr4IqYK3QvlITpjtL3/yLr1MOQjoQsbIhggu+lKGSiTDlcMnPKFlUTUwiB3 yNuCmi0ic8Y+oYpsLTcNN4bWeZF0RJytKWu8rsvWRc6HynSr41ORCxZVGG4wNhSbRBfP dqCnDN1fSLHRSsf9rQvpZl06VPWL/tOc3UbR6QOuco586Y3F4uBGNvrwwH/Mx300XHXH +Ui1l58WLr/G8ia9aP04B0NsqazcThvDkd27h/yrCkw3FTthyT2xUAPg8Nxv6wfVLncB Yuujs4+nlhg0/y33RSAO1CwdsmaNHXgbZkaMdbVHYvaHeN6Kvva640MOJFjKSSRT6Mdc fZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IJeZom9qkXzqxPwuKnHxqdwronErtapgs4T9aydrlvU=; b=b2vtJ3JhjrK+qrU9n0ogWJv1IUWZw8zEezAXtrDkQad8wUeCRmIsrRjWpjKR4FVOuD isdlOm/4vjwubsypMsr9dAD9LY143tDLAcPGJTQjnf8J+S+k8b/TyEyKZb/QyY20a5OY FyrPDW7zWQFIevpCyXz7dfy7o7z1S1kCvJFsevRiDuwnquBGi90ZWK2d3eMoB8T22ZzD /HCwdd+ZvflhRcB6nEJ7vtYjNMBhlS1p4esQd19oyr5pOnThRFF6rvWazhMexQ8vNva6 VtH5LmchwnottbXWLgsiaENMAAQ0Fx20TPA4xvNjN2dKnz7KeFQO4SrKapKOSbzcNMlw 2+Fg== X-Gm-Message-State: APjAAAWPVGWy3hVe2hrArF8sxVFzn3SG315UteRW2ujOWiKY2BxWBZOl ZMXVT/amusx2R5I9eyAiKTHP8g== X-Google-Smtp-Source: APXvYqzQut0W6YclmulkaVz7nQGpqbQo/tavsYYt7mgjjoMhmg6juuBz4XRhqCUQICde7qks8Qxabg== X-Received: by 2002:a65:4b88:: with SMTP id t8mr51210039pgq.374.1558024623252; Thu, 16 May 2019 09:37:03 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 85sm9186076pgb.52.2019.05.16.09.37.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 09:37:03 -0700 (PDT) Date: Thu, 16 May 2019 09:36:55 -0700 From: Stephen Hemminger To: Mesut Ali Ergin Cc: olivier.matz@6wind.com, dev@dpdk.org Message-ID: <20190516093655.2606d732@hermes.lan> In-Reply-To: <1557985267-280205-1-git-send-email-mesut.a.ergin@intel.com> References: <1557985267-280205-1-git-send-email-mesut.a.ergin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] kvargs: trim spaces at the beginning and end of key and values X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 15 May 2019 22:41:07 -0700 Mesut Ali Ergin wrote: > +/* trim leading and trailing spaces */ > +static char * > +trim_space(char *str) > +{ > + char *start, *end; > + > + for (start = str; *start; start++) { > + if (!isspace((unsigned char) start[0])) > + break; > + } > + > + for (end = start + strlen(start); end > start + 1; end--) { > + if (!isspace((unsigned char) end[-1])) > + break; > + } > + Why not use existing string functions like strspn?