From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 145A742C04; Thu, 1 Jun 2023 17:05:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FAF542FB4; Thu, 1 Jun 2023 17:01:41 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 2AB6F42F98 for ; Thu, 1 Jun 2023 17:01:38 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1b025d26f4fso8145165ad.1 for ; Thu, 01 Jun 2023 08:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631697; x=1688223697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8lw1+NY0rVzeC60tyo98Jv1WJw98RbrAw+E0e1/CcMg=; b=PMms9MbekNylw/roFTLbpMx97ViDUc1h54OUsQCbQElnsHNKRRfHOZ95qZrWpuH6z6 h5c5LHif5xj82A8pTlxsR/FkEfVro/Xjz1dor0HYlIQ/7/ctT9DKnzZglsv7w3ZcPcc8 j+QlCP8Baw7mI9B2GdLFTVc/d9GB1vrfAvYTWQbxNRP3vhKkTY0qZ/ZSAVUjAZVIwYq/ FOLMAPN1oBsrc1tlEUTfFQskTQwGIk51wNXx+ceMHh9ZI7qFBw6hZ+zwnJr2eDOPuHa1 79H20g+3ImCjSZuHTMmv28v5c2R+afGdhadpYNTfIVQksNcnE8Blvsa5cdD/72l8n2d5 P36Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631697; x=1688223697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8lw1+NY0rVzeC60tyo98Jv1WJw98RbrAw+E0e1/CcMg=; b=dYWwbBm6ios3xPSG46BWrVJ8sQU5o8PaH/MzNF/bCGKWePXEOQS9YVxlrm6VenajGP SkFJAqen60zqVh4z4JkwF83FIZxcNERNDI3gmDZx8M5L20RhwZVUN2t+jxP8W+VezyHJ v9pFM5u0N8gbEtWXVotClone3mMKQIRCtX8mfwPKIZrlRbWGEL2mSw8chI1mWCvG89jy IOjtNPsnlRX3QkpdpoFogHSFByt7nIOe67ksCM0/uNemkbNHGXgO+WGTK8kD+7aX96SZ bYxYPxnzZin0vDrIDrTpjYlhdImn1MoK/Wby0bn3SbioieBrytFYB8pJ/ZI/IQwBbDEQ NzDg== X-Gm-Message-State: AC+VfDzzLqsjG4gNWz4BuVbAtZFMofOOkHwVpRuskPC0w7AXb34h0cjN iG5PCTlsBR26GgorRYiVP9tvVZHPMkmkIAs4tQ3SYA== X-Google-Smtp-Source: ACHHUZ6wccw379AsBn6Pn59ltIbIK9gpZF1aC46OQjmlRjuMD6b4TWEVDtNXtgTnUia9LBR07CANFg== X-Received: by 2002:a17:902:ba95:b0:1b0:3f89:9836 with SMTP id k21-20020a170902ba9500b001b03f899836mr7711139pls.22.1685631697468; Thu, 01 Jun 2023 08:01:37 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id ij9-20020a170902ab4900b001ac40488620sm3661955plb.92.2023.06.01.08.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:37 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Chaoyong He , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH 22/25] net/nfp: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:01:03 -0700 Message-Id: <20230601150106.18375-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230601150106.18375-1-stephen@networkplumber.org> References: <20230601150106.18375-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Suggested by devtools/cocci/strlcpy-with-header.cocci Signed-off-by: Stephen Hemminger --- drivers/net/nfp/flower/nfp_flower_representor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 362c67f7b56d..09e0447d9268 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -600,7 +600,7 @@ nfp_flower_pf_repr_init(struct rte_eth_dev *eth_dev, repr->repr_type = init_repr_data->repr_type; repr->app_fw_flower = init_repr_data->app_fw_flower; - snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name); + strlcpy(repr->name, init_repr_data->name, sizeof(repr->name)); eth_dev->dev_ops = &nfp_flower_pf_repr_dev_ops; eth_dev->rx_pkt_burst = nfp_flower_pf_recv_pkts; @@ -671,7 +671,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev, repr->repr_type = init_repr_data->repr_type; repr->app_fw_flower = init_repr_data->app_fw_flower; - snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name); + strlcpy(repr->name, init_repr_data->name, sizeof(repr->name)); eth_dev->dev_ops = &nfp_flower_repr_dev_ops; eth_dev->rx_pkt_burst = nfp_flower_repr_rx_burst; -- 2.39.2