> -----Original Message----- > From: Parthasarathy, JananeeX M > Sent: Friday 15 February 2019 11:08 > To: Yigit, Ferruh <ferruh.yi...@intel.com>; Poornima, PallantlaX > <pallantlax.poorn...@intel.com>; dev@dpdk.org > Cc: Pattan, Reshma <reshma.pat...@intel.com>; Mokhtar, Amr > <amr.mokh...@intel.com>; sta...@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] app/testbbdev: fix sprintf with snprintf > > Hi > > >-----Original Message----- > >From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Ferruh Yigit > >Sent: Friday, February 08, 2019 7:44 PM > >To: Poornima, PallantlaX <pallantlax.poorn...@intel.com>; > dev@dpdk.org > >Cc: Pattan, Reshma <reshma.pat...@intel.com>; Mokhtar, Amr > ><amr.mokh...@intel.com>; sta...@dpdk.org > >Subject: Re: [dpdk-dev] [PATCH] app/testbbdev: fix sprintf with snprintf > > > >On 2/4/2019 7:15 AM, Pallantla Poornima wrote: > >> @@ -825,7 +825,7 @@ > >> > >> test_bbdev_driver_init(void) > >> > >> TEST_ASSERT_FAIL(rte_bbdev_release(NULL), > >> "Failed to uninitialize bbdev driver with NULL bbdev"); > >> - sprintf(name_tmp, "%s", "invalid_name"); > >> + snprintf(name_tmp, sizeof(name_tmp), "%s", "invalid_name"); > >> dev2 = rte_bbdev_get_named_dev(name_tmp); > >> TEST_ASSERT_FAIL(rte_bbdev_release(dev2), > >> "Failed to uninitialize bbdev driver with invalid name"); > > > >Can use strlcpy() instead of snprintf() here. > > Please confirm whether we can do this change (snprintf to strlcpy) as there > was Ack from other reviewer.
I agree with Ferruh suggestion, as this is a simple string copying. Feel free to use strlcpy instead and retain my Ack. Thanks. > Thanks > M.P.Jananee