OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c96e25
)
Fix strxfrm, which was broken (thanks to Shaya Potter <spotter@us.ibm.com>
author
Eric Andersen
<andersen@codepoet.org>
Fri, 6 Jul 2001 17:43:05 +0000
(17:43 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Fri, 6 Jul 2001 17:43:05 +0000
(17:43 -0000)
for noticing, and cleanup a warning.
-Erik
libc/string/string.c
patch
|
blob
|
history
diff --git
a/libc/string/string.c
b/libc/string/string.c
index
0a1ced8
..
4a367b5
100644
(file)
--- a/
libc/string/string.c
+++ b/
libc/string/string.c
@@
-63,8
+63,6
@@
char *strcpy(char *dst, const char *src)
#ifdef L_stpcpy
char *stpcpy(char *dst, const char *src)
{
- register char *ptr = dst;
-
while (*src)
*dst++ = *src++;
*dst = '\0';
@@
-164,7
+162,11
@@
char *strncpy(char *dst, const char *src, size_t len)
#ifdef L_strxfrm
size_t strxfrm(char *dst, const char *src, size_t len)
{
+ size_t length;
strncpy( dst, src, len);
+ length = strlen(src);
+ if (length<len)
+ return(length);
return( len);
}
#endif