Skip to content

Commit c6923f5

Browse files
committed
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.
1 parent 13d9d50 commit c6923f5

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

lib/libc/string0.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,6 @@ char *strcpy(char *dest, const char *src) {
169169
return dest;
170170
}
171171

172-
char *strncpy(char *dest, const char *src, size_t dest_sz) {
173-
char *d = dest;
174-
while (*src && --dest_sz) {
175-
*d++ = *src++;
176-
}
177-
*d = '\0';
178-
return dest;
179-
}
180-
181172
// needed because gcc optimises strcpy + strcat to this
182173
char *stpcpy(char *dest, const char *src) {
183174
while (*src) {

0 commit comments

Comments
 (0)