Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
2014-10-16 20:05 GMT+02:00 Jason Cooper : > On Thu, Oct 16, 2014 at 10:55:57AM -0700, Joe Perches wrote: >> On Thu, 2014-10-16 at 13:48 -0400, Jason Cooper wrote: >> > On Thu, Oct 16, 2014 at 10:25:03AM -0700, Joe Perches wrote: >> > > On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: >

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Jason Cooper
On Thu, Oct 16, 2014 at 10:55:57AM -0700, Joe Perches wrote: > On Thu, 2014-10-16 at 13:48 -0400, Jason Cooper wrote: > > On Thu, Oct 16, 2014 at 10:25:03AM -0700, Joe Perches wrote: > > > On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: > > > > The buf is used to hold the list of hwrn

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Joe Perches
On Thu, 2014-10-16 at 13:48 -0400, Jason Cooper wrote: > On Thu, Oct 16, 2014 at 10:25:03AM -0700, Joe Perches wrote: > > On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: > > > The buf is used to hold the list of hwrng devices registered. > > > The old code ensures we don't walk off th

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Jason Cooper
On Thu, Oct 16, 2014 at 07:15:22PM +0200, Rickard Strandqvist wrote: > The buf is used to hold the list of hwrng devices registered. > The old code ensures we don't walk off the end of buf as we > fill it, but it's unnecessarily complicated and thus difficult > to maintain. Simplify it by using str

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Joe Perches
On Thu, 2014-10-16 at 19:41 +0200, Rickard Strandqvist wrote: > 2014-10-16 19:25 GMT+02:00 Joe Perches : > > On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: > >> The buf is used to hold the list of hwrng devices registered. > >> The old code ensures we don't walk off the end of buf as

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Jason Cooper
On Thu, Oct 16, 2014 at 10:25:03AM -0700, Joe Perches wrote: > On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: > > The buf is used to hold the list of hwrng devices registered. > > The old code ensures we don't walk off the end of buf as we > > fill it, but it's unnecessarily complica

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
2014-10-16 19:25 GMT+02:00 Joe Perches : > On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: >> The buf is used to hold the list of hwrng devices registered. >> The old code ensures we don't walk off the end of buf as we >> fill it, but it's unnecessarily complicated and thus difficult

Re: [PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Joe Perches
On Thu, 2014-10-16 at 19:15 +0200, Rickard Strandqvist wrote: > The buf is used to hold the list of hwrng devices registered. > The old code ensures we don't walk off the end of buf as we > fill it, but it's unnecessarily complicated and thus difficult > to maintain. Simplify it by using strlcat. >

[PATCH 3v] char: hw_random: core.c: Changed from using strncat to strlcat

2014-10-16 Thread Rickard Strandqvist
The buf is used to hold the list of hwrng devices registered. The old code ensures we don't walk off the end of buf as we fill it, but it's unnecessarily complicated and thus difficult to maintain. Simplify it by using strlcat. We also ensure the string within buf is NULL terminated so the final st