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 CD14742C04; Thu, 1 Jun 2023 17:05:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61D6042FBC; Thu, 1 Jun 2023 17:01:42 +0200 (CEST) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 99E5C42FA4 for ; Thu, 1 Jun 2023 17:01:39 +0200 (CEST) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-53404873a19so487638a12.3 for ; Thu, 01 Jun 2023 08:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631698; x=1688223698; 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=g3b3IZxmWuRpIxKYlTZSiLXGvuEHR7RHcxIKtL6KXM8=; b=3TmJPqfX2nmUAcR+FviwbHRhciKtaE4lbyAxL6k5m8/9A7P36d8mg/8x6ZWA44SzPV jgeNLNyZvB8IM1uLWHcTNxkvPBdOHFqu/TF/bkybIcLBzhjGhcGRFN9g1ShpghXr4NK8 jEKc+xhQtvclB9YGLUUsw0EVZXUh9kAWZ2bvcMZcMLeV6nQ+3PGVCFIj6mqv6hDG7PjX OfDTuATn4CeReTEYlmzA7YIstiAVR+q2YUc+JgkNy4eQAdDVpiG9vzQUS6zwRWxBjckW IsaxCZXVd6QG4NByA0YMjtEqqPO4KKtzJrk4O218ZXyZdJ4XWvUrzMbgYMQbnTDumR7g WrDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631698; x=1688223698; 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=g3b3IZxmWuRpIxKYlTZSiLXGvuEHR7RHcxIKtL6KXM8=; b=iIdBirJ+srVQviHXjju8oNqg97AQSe8fiegZvfw4w6T7DOsK7Hq6CVV09mXfQLCNKc RJixvq+nSdB9mGI2i12v6DAId2LHvvADefvwsVtgri2HgZ/pZlFY6lHVeuTJmp6/1QwL XbTeBBLU/iMt0yNJUObDc5tgub/ai8xXbeogwLa77YIJwoa7qW8xDw1upNfBkpAMAIk+ YXwLaAeQ1GUAHpmzBFcD0sVGLs2ZZtE+TJrkgbcdRrc6G7bWh9TKcz0pXgy5Ol3lXLR2 Zh7qDW93Z55yXAFaIC+b8Brm0vHbbLTkplpeN9V9MgUlrVq5V66gpQtwYUspfKDjMtH5 VtkQ== X-Gm-Message-State: AC+VfDzMNwpsXYHTw849l4ws43/rCm10OODtlmHmQqbK5Fg/RP2I+r3G e2PRlgNQ/dFH3GJBMtT26ncXyy3OX0FRU3ggTnkQOw== X-Google-Smtp-Source: ACHHUZ4aIaXQpg7Ewj1Shq/d3KfPvl4G6uPkoFnnZXfDZ6HvJH+MW+sVEW306nG/X5sQ25tgcl+8qA== X-Received: by 2002:a17:902:d2ca:b0:1b1:7890:ff48 with SMTP id n10-20020a170902d2ca00b001b17890ff48mr3430555plc.5.1685631698399; Thu, 01 Jun 2023 08:01:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:38 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiawen Wu Subject: [PATCH 23/25] net/ngbe: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:01:04 -0700 Message-Id: <20230601150106.18375-24-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/ngbe/ngbe_rxtx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c index 0c678e155726..dc6043f3620a 100644 --- a/drivers/net/ngbe/ngbe_rxtx.c +++ b/drivers/net/ngbe/ngbe_rxtx.c @@ -1875,8 +1875,8 @@ ngbe_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, for (i = 0; i < RTE_DIM(ngbe_tx_burst_infos); ++i) { if (pkt_burst == ngbe_tx_burst_infos[i].pkt_burst) { - snprintf(mode->info, sizeof(mode->info), "%s", - ngbe_tx_burst_infos[i].info); + strlcpy(mode->info, ngbe_tx_burst_infos[i].info, + sizeof(mode->info)); ret = 0; break; } @@ -2785,8 +2785,8 @@ ngbe_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, for (i = 0; i < RTE_DIM(ngbe_rx_burst_infos); ++i) { if (pkt_burst == ngbe_rx_burst_infos[i].pkt_burst) { - snprintf(mode->info, sizeof(mode->info), "%s", - ngbe_rx_burst_infos[i].info); + strlcpy(mode->info, ngbe_rx_burst_infos[i].info, + sizeof(mode->info)); ret = 0; break; } -- 2.39.2