lib/libc/string0: Remove better-than-standard strncpy() implementation.
ANSI C doesn't require that strncpy() produced null-terminated string, so it's basicly useless for string manipulation.
This commit is contained in:
parent
13d9d50fea
commit
c6923f52f0
@ -169,15 +169,6 @@ char *strcpy(char *dest, const char *src) {
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *strncpy(char *dest, const char *src, size_t dest_sz) {
|
||||
char *d = dest;
|
||||
while (*src && --dest_sz) {
|
||||
*d++ = *src++;
|
||||
}
|
||||
*d = '\0';
|
||||
return dest;
|
||||
}
|
||||
|
||||
// needed because gcc optimises strcpy + strcat to this
|
||||
char *stpcpy(char *dest, const char *src) {
|
||||
while (*src) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user