libc: fix strncpy - must set nil bytes
This commit is contained in:
parent
522cda0456
commit
eff00f21c4
|
@ -9,5 +9,9 @@ char * strncpy(char * dest, const char * src, size_t n) {
|
|||
++src;
|
||||
--n;
|
||||
}
|
||||
for (int i = 0; i < (int)n; ++i) {
|
||||
*out = '\0';
|
||||
++out;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue