linux-mips
[Top] [All Lists]

strncpy etc.

To: linux-mips@linux-mips.org
Subject: strncpy etc.
From: "Kip Walker" <kwalker@broadcom.com>
Date: Mon, 18 Nov 2002 14:29:48 -0800
Cc: "Ralf Baechle" <ralf@linux-mips.org>
Organization: Broadcom Corp. BPBU
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Looks like a typo in include/asm-mips/string.h has strncpy returning the
wrong thing -- a pointer to the END of the destination string, rather
than the beginning of the destination string.

Patch for 2.4 is below:

Index: include/asm-mips/string.h
===================================================================
RCS file:
/projects/bbp/cvsroot/systemsw/linux/src/kernel/include/asm-mips/string.h,v
retrieving revision 1.6
diff -u -r1.6 string.h
--- string.h    2002/09/05 22:15:51     1.6
+++ string.h    2002/11/18 22:27:15
@@ -67,7 +67,7 @@
         : "0" (__dest), "1" (__src), "2" (__n)
         : "memory");
 
-  return __dest;
+  return __xdest;
 }
 
 #define __HAVE_ARCH_STRCMP


<Prev in Thread] Current Thread [Next in Thread>
  • strncpy etc., Kip Walker <=