RE: [PATCH] powerpc: use strscpy to copy strings

2021-12-20 Thread David Laight
From: Jason Wang > Sent: 20 December 2021 03:24 > > The strlcpy should not be used because it doesn't limit the source > length. So that it will lead some potential bugs. > > But the strscpy doesn't require reading memory from the src string > beyond the specified "count" bytes, and since the ret

[PATCH] powerpc: use strscpy to copy strings

2021-12-19 Thread Jason Wang
The strlcpy should not be used because it doesn't limit the source length. So that it will lead some potential bugs. But the strscpy doesn't require reading memory from the src string beyond the specified "count" bytes, and since the return value is easier to error-check than strlcpy()'s. In addit