From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by dpdk.org (Postfix) with ESMTP id 91C38F94 for ; Sat, 9 Mar 2019 01:48:57 +0100 (CET) Received: by mail-pg1-f172.google.com with SMTP id l11so15417275pgq.10 for ; Fri, 08 Mar 2019 16:48:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=hRGUVHublYncZZJx4Dt5M90Aw8CFt9WXBsPnxSa6Cag=; b=Yuv+NMM04tFoFJHSadQxmYd/wyeCR49FUxCn4+wEeWYRqgwqcgl92OlwPuFN0l5WzW csXXaO5UnZ4CUU9hYoefa5eHV5IRNGCtxGEIJLHlj1qoINTRnaG0VTVOeMlmu1jJNZRo DhvgR+UIlWJZovAGObs1B3HkGa4KqnBkp6vCtJ9z0yWpoEPV/a6zAZCed+KkKkbjwdHm RJZFVURQIFko7kt3KeL9uVgAqXXddO/ts+ZlbobelfFxOxBU3LvZgIUumIpOmPLTFLnf Vmi2yui0kVpVTlBJoUFqN5hgeypsxAIcsW2FemJJHUFLYRrj8vdhrL1Lzu4x9K8EfjJ0 ecLw== 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:subject:message-id:mime-version :content-transfer-encoding; bh=hRGUVHublYncZZJx4Dt5M90Aw8CFt9WXBsPnxSa6Cag=; b=Rbl7qIE2ImO56muduzUiWv8KyELdYsOxi+qPY8McRDE20pe3jdSOwv0RR79ZQWN7od hL40zMCTk8ea74LhfK0LTy4lNtwBd21tIqzpnE7qOJa52J2rGPovqzaAOGhrj/LAoT9h xwRq+Y3eEDwo7oxvTozHnL+XaLycLr9MeB1g6EEbr1lS2y6wNcQv0/JTwaqQkyKUn3/o I82s2LEYMXPLCwhxs6covDYNZIFLx4bxhirh7O3JxxRRXXv7v3dBbpBHc3oZdMjf1Y97 0PdnetleVogAyB8t7kA/8M04rtZai5+D0xM8Z5vq2txmqnWJC91pfelkeCHN+i2vHvJj EIfA== X-Gm-Message-State: APjAAAW4Lq1tUL+QyVZh8QikxIER9lZ0gCrlfZnIyAOFzJ28MrbcLj2a wFkkPV75T8NZD4Tsr6kZwyYikiGJXXM= X-Google-Smtp-Source: APXvYqwwvlR6w1nnO6B5gLrIs1szUeERgkxTovzeXA+nFQvN0KcUVnVL7MWSX3y1dnf9oQFAF6qs7w== X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr21231900plb.147.1552092536407; Fri, 08 Mar 2019 16:48:56 -0800 (PST) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h126sm28020982pfc.135.2019.03.08.16.48.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 16:48:56 -0800 (PST) Date: Fri, 8 Mar 2019 16:48:51 -0800 From: Stephen Hemminger To: dev@dpdk.org Message-ID: <20190308164851.46fe24b6@shemminger-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] replacing snprintf with strlcpy where possible 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: , X-List-Received-Date: Sat, 09 Mar 2019 00:48:57 -0000 If someone is familiar with coccinelle it should be possible to replace all uses of: snprintf(buf, sizeof(buf), "%s", foo); with: strlcpy(buf, foo, sizeof(buf)); using semantic patch $ git grep snprintf | grep '"%s"' | grep -v ' = ' | wc -l 114 This could go on the cleanup dpdk-newbies list if there was one.