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 0266C42C04; Thu, 1 Jun 2023 17:03:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96C5E42DA2; Thu, 1 Jun 2023 17:01:31 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 9D36F42D7C for ; Thu, 1 Jun 2023 17:01:28 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1b0424c5137so8066885ad.1 for ; Thu, 01 Jun 2023 08:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631687; x=1688223687; 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=42w8IFnPtQZmyRCLOmEdVnUarPz4yi1d8NICTDvg0BA=; b=KgRKAFFRGwG+farOIYzXOJWDcpnGr4btTyGolXqJrl4CXrCpKSDwXEDvkdUDXVn08r zWz+Vy6X6pwpsQ/h73prawJkulnXzYGTY/WMtkXOscUbMx/Z2k+NFBoP3qtmtjTo3el0 5pHfvRw4Kq60+8m+8lQtwxG7u+uR0ZhL8EVA3KF+EdbLqp5Vk8c5QXM4oYCP4Sz3TbYZ 40GZQsBKQWVAiw6PD8TRNPCX72299AEBHfRDUve5O84g38HfRw324hkBcvt6c5pcTG1T v0RNl+V8tri3HIb0C1cJYMHLM2ykUBH1Q4xwJlaLizO1KjAyg2gtZ7ncbhaDfeut2G4b M3Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631687; x=1688223687; 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=42w8IFnPtQZmyRCLOmEdVnUarPz4yi1d8NICTDvg0BA=; b=Bu2v0314uZoGNLy0XAweR/NHdla9J1Bgv8JQXD4cZBjbhP9khasEC+4WEgX3BHKgo6 PnNKyvYEAiW1jueUD3QZODHDPqSFIEp2Y4tEwz0cuEfyGRa7H9nZ/5HH4w8DM8FNysiB NM+9f7dy3YtuDczH/YImrC+bKpT2pot9FWVBNGAq1eY+7xXFMC0lDJr3ScTxeUuCOUsd VRIuc+YbPn2HapOSNeHfnjZGK/Cib3RnO/AhGWw7sp71PRL0CUCM3152Hqo0Io6QN7Yx hAcMsnhCiRyArHZLunw350yqQcArHbmUTQ9OBjlBjGUN8An37khcm3l5jv/yCbMFfbjK TIbw== X-Gm-Message-State: AC+VfDx7SHgFTRPVweEqwuH65FcJf/sMm8H+MSb0LiDlW00OIrMmbbBg UNVSL2dsduLj6Pbkb23fCiqWqPn50Mlf/lYgwzd+Vg== X-Google-Smtp-Source: ACHHUZ6DbPKqWR+1NUp2j8E2bs5ApApUavhGNI0fVYj8ld5bDyXaYpAS6BIIs0VdevjbIWofeVKGzw== X-Received: by 2002:a17:902:db02:b0:1b1:99c9:8cfa with SMTP id m2-20020a170902db0200b001b199c98cfamr3208066plx.14.1685631687667; Thu, 01 Jun 2023 08:01:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:27 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ajit Khaparde , Somnath Kotur Subject: [PATCH 13/25] net/bnxt: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:00:54 -0700 Message-Id: <20230601150106.18375-14-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/bnxt/bnxt_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index ef7b8859d997..d6aa84f6d3e4 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -2983,8 +2983,8 @@ bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, for (i = 0; i < RTE_DIM(bnxt_rx_burst_info); i++) { if (pkt_burst == bnxt_rx_burst_info[i].pkt_burst) { - snprintf(mode->info, sizeof(mode->info), "%s", - bnxt_rx_burst_info[i].info); + strlcpy(mode->info, bnxt_rx_burst_info[i].info, + sizeof(mode->info)); return 0; } } @@ -3017,8 +3017,8 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, for (i = 0; i < RTE_DIM(bnxt_tx_burst_info); i++) { if (pkt_burst == bnxt_tx_burst_info[i].pkt_burst) { - snprintf(mode->info, sizeof(mode->info), "%s", - bnxt_tx_burst_info[i].info); + strlcpy(mode->info, bnxt_tx_burst_info[i].info, + sizeof(mode->info)); return 0; } } -- 2.39.2