git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
taskfs fix up, minor refactoring
[lunaix-os.git]
/
lunaix-os
/
libs
/
klibc
/
string
/
strcpy.c
diff --git
a/lunaix-os/libs/klibc/string/strcpy.c
b/lunaix-os/libs/klibc/string/strcpy.c
index 7a3b430faad8a4cc673073ee752b7de6f099691c..400aeec4ae1c52ade64a890db2a41ab5ebdd5a48 100644
(file)
--- a/
lunaix-os/libs/klibc/string/strcpy.c
+++ b/
lunaix-os/libs/klibc/string/strcpy.c
@@
-27,18
+27,13
@@
strcpy(char* dest, const char* src)
char* _weak
strncpy(char* dest, const char* src, unsigned long n)
{
char* _weak
strncpy(char* dest, const char* src, unsigned long n)
{
- char c;
+ char c
= '\0'
;
unsigned int i = 0;
unsigned int i = 0;
- while (i <
=
n && (c = src[i]))
+ while (i < n && (c = src[i]))
dest[i++] = c;
dest[i++] = c;
- if (!(n < i && src[i - 1])) {
- while (i <= n)
- dest[i++] = 0;
- }
- else {
- dest[i - 1] = 0;
- }
+ while (i < n)
+ dest[i++] = 0;
return dest;
}
\ No newline at end of file
return dest;
}
\ No newline at end of file