Re: [TESTSUITE]Use strncpy instead of strcpy in testsuite/gcc.dg/memcmp-1.c

2017-08-30 Thread Mike Stump
On Aug 30, 2017, at 8:31 AM, Renlin Li wrote: > memcpy is better than strncpy in this case. > Here is the updated patch. Ok.

Re: [TESTSUITE]Use strncpy instead of strcpy in testsuite/gcc.dg/memcmp-1.c

2017-08-30 Thread Renlin Li
Hi Aaron, On 30/08/17 15:37, Aaron Sawdey wrote: On Wed, 2017-08-30 at 10:16 +0100, Renlin Li wrote: Hi, Hi, Renlin you are correct that it shouldn't be using strcpy because the string may not be null terminated. However I would suggest we use memcpy instead of strncpy. The reason is

Re: [TESTSUITE]Use strncpy instead of strcpy in testsuite/gcc.dg/memcmp-1.c

2017-08-30 Thread Aaron Sawdey
On Wed, 2017-08-30 at 10:16 +0100, Renlin Li wrote: > Hi, > > In test_driver_memcmp function, I found buf1 and buf2 is not properly > terminated with null character. > > In lib_strncmp, strcpy will be called with buf1 and buf2. > The normal implementation of strcpy function has a loop to copy >

[TESTSUITE]Use strncpy instead of strcpy in testsuite/gcc.dg/memcmp-1.c

2017-08-30 Thread Renlin Li
Hi, In test_driver_memcmp function, I found buf1 and buf2 is not properly terminated with null character. In lib_strncmp, strcpy will be called with buf1 and buf2. The normal implementation of strcpy function has a loop to copy character from source to destination one by one until a null