Hello, 

the ppc memset, memcpy, memmove from string.h didn't work for me. Busybox-Vi 
always got a segfault. I only debugged the memset.c. Memmove and memcpy were 
replaced by simpler functions. 
The failure is in the "align" section. In the case that only n==1 characters 
had to be replaced and for an aligned adress there are remaining rem==3 spaces 
with n=n-rem; an overflow occurred. 

I'm running a MPC5554. 

greetings
Erik


--- uClibc/libc/string/powerpc/memset.c	2007-07-04 09:10:20.000000000 +0200
+++ uClibc_new/libc/string/powerpc/memset.c	2008-03-17 11:16:14.000000000 +0100
@@ -70,7 +70,13 @@
 	return to;
  align:
 	rem = 4 - rem;
-	n = n-rem;
+	if(n>=rem)
+		n = n-rem;
+	else
+	{
+		rem = n;
+		n = 0;
+	}
 	do {
 		*(tmp_to+4) = c;
 		++tmp_to;
_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to