Re: [PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Joel Sherrill
On Wed, Aug 12, 2020 at 9:43 AM Aschref Ben-Thabet < aschref.ben-tha...@embedded-brains.de> wrote: > Hello joel, Gedare, > > i think in this way , we may use Strdup/ Strrndup instead of memcpy to > guarantee the copy of null terminated String. > in this case we don't need to allocate memory, sin

Re: [PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Sebastian Huber
Hello Aschref, On 12/08/2020 14:06, Aschref Ben-Thabet wrote: From: Aschref Ben Thabet replace strncpy with memcpy to silence this warning and free the allocated memory block. --- testsuites/psxtests/psxndbm01/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test

Re: [PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Aschref Ben-Thabet
Hello joel, Gedare, i think in this way , we may use Strdup/ Strrndup instead of memcpy to guarantee the copy of null terminated String. in this case we don't need to allocate memory, since Strdup do this one. i m unconscious with the line #224 key.dsize = sizeof( test_strings ) then i have

Re: [PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Joel Sherrill
On Wed, Aug 12, 2020 at 8:41 AM Gedare Bloom wrote: > On Wed, Aug 12, 2020 at 7:03 AM Joel Sherrill wrote: > > > > > > > > On Wed, Aug 12, 2020 at 7:07 AM Aschref Ben-Thabet < > aschref.ben-tha...@embedded-brains.de> wrote: > >> > >> From: Aschref Ben Thabet > >> > >> replace strncpy with memcp

Re: [PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Gedare Bloom
On Wed, Aug 12, 2020 at 7:03 AM Joel Sherrill wrote: > > > > On Wed, Aug 12, 2020 at 7:07 AM Aschref Ben-Thabet > wrote: >> >> From: Aschref Ben Thabet >> >> replace strncpy with memcpy to silence this warning and free the >> allocated memory block. > > > I don't see a call to strncpy being rep

Re: [PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Joel Sherrill
On Wed, Aug 12, 2020 at 7:07 AM Aschref Ben-Thabet < aschref.ben-tha...@embedded-brains.de> wrote: > From: Aschref Ben Thabet > > replace strncpy with memcpy to silence this warning and free the > allocated memory block. > I don't see a call to strncpy being replaced. Maybe I need coffee. I see

[PATCH] Psxtest : Fix String Turncation warning

2020-08-12 Thread Aschref Ben-Thabet
From: Aschref Ben Thabet replace strncpy with memcpy to silence this warning and free the allocated memory block. --- testsuites/psxtests/psxndbm01/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuites/psxtests/psxndbm01/init.c b/testsuites/psxtests/psxndbm01/i