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;
}