[patch] fix for strcat and strncat on the SPU

Jeff Johnston jjohnstn@redhat.com
Tue Jun 10 08:26:00 GMT 2008


Seeing as the revised patch accounts for the comment received, I have 
checked it in.

With regards to your SPU timer patch, if Kazunori has no further 
questions or comments regarding your reply to him then I'll be happy to 
check it in too.

-- Jeff J.

Ken Werner wrote:
> On Monday 09 June 2008 12:02, Kazunori Asayama wrote:
>   
>> It seems to be sufficient to just return 'dest' instead of 'ret'. The
>> _straddr(dest) may return a different value from 'dest', however it
>> never modifies the original 'dest'.
>>     
>
> Thanks for reviewing the patch. Here is an updated version.
>
> Ken
>
> newlib/ChangeLog:
>
> 2008-06-09  Ken Werner  <ken.werner@de.ibm.com>
>
> 	* libc/machine/spu/strcat.c: Return value fixed.
> 	* libc/machine/spu/strncat.c: Likewise.
>
> Index: src/newlib/libc/machine/spu/strcat.c
> ===================================================================
> --- src.orig/newlib/libc/machine/spu/strcat.c
> +++ src/newlib/libc/machine/spu/strcat.c
> @@ -41,5 +41,6 @@
>   */
>  char *strcat(char * __restrict__ dest, const char * __restrict__ src)
>  {
> -  return _strncpy(_straddr(dest), src, 0, 0, 0);
> +  _strncpy(_straddr(dest), src, 0, 0, 0);
> +  return dest;
>  }
> Index: src/newlib/libc/machine/spu/strncat.c
> ===================================================================
> --- src.orig/newlib/libc/machine/spu/strncat.c
> +++ src/newlib/libc/machine/spu/strncat.c
> @@ -41,5 +41,6 @@
>  char * strncat(char * __restrict__ dest, const char * __restrict__ src,
>                 size_t n)
>  {
> -  return _strncpy(_straddr(dest), src, n, 1, 1);
> +  _strncpy(_straddr(dest), src, n, 1, 1);
> +  return dest;
>  }
>   



More information about the Newlib mailing list