[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301131513124870047@zte.com.cn>
Date: Fri, 13 Jan 2023 15:13:12 +0800 (CST)
From: <yang.yang29@....com.cn>
To: <kuba@...nel.org>
Cc: <santosh.shilimkar@...cle.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<rds-devel@....oracle.com>, <linux-kernel@...r.kernel.org>,
<xu.panda@....com.cn>
Subject: Re: [PATCH net-next v2] net/rds: use strscpy() to instead of strncpy()
> What are the differences in behavior between strncpy() and strscpy()?
Strscpy() makes the dest string NUL-terminated, and returns more
useful value. While strncpy() can initialize the dest string.
Here we use strscpy() to make dest string NUL-terminated, and use
return value to check src string size and dest string size. This make
the code simpler.
Powered by blists - more mailing lists