mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Perform inconsequential code cleanup
This commit is contained in:
parent
929478c524
commit
decf216655
52 changed files with 326 additions and 442 deletions
|
@ -27,12 +27,14 @@
|
|||
* @param 𝑛 is maximum number of characters from s to copy
|
||||
* @return 𝑑
|
||||
* @note 𝑑 and 𝑠 can't overlap
|
||||
* @asyncsignaslenafe
|
||||
* @asyncsignalsafe
|
||||
*/
|
||||
char *strncat(char *d, const char *s, size_t n) {
|
||||
size_t o;
|
||||
if (!memccpy(d + (o = strlen(d)), s, '\0', n)) {
|
||||
d[o + n] = '\0';
|
||||
size_t dn, sn;
|
||||
if ((sn = strnlen(s, n))) {
|
||||
dn = strlen(d);
|
||||
memcpy(d + dn, s, sn);
|
||||
d[dn + sn] = 0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue