forked from len0rd/rockbox
add memccpy.c
Not sure if this is worth the added bin size yet but I will see where I can use it to try and make it worth it Change-Id: Icc299d3986172ff224a14be48da3bf065d728a66
This commit is contained in:
parent
034b6d5bfb
commit
b25a9d8f99
6 changed files with 139 additions and 5 deletions
|
@ -1627,7 +1627,9 @@ static int ata_smart_attr_to_string(
|
|||
if (len >= name_sz) len = name_sz-1;
|
||||
slen += len;
|
||||
}
|
||||
snprintf(str+slen, size-slen, "%s", buf);
|
||||
|
||||
if (!memccpy (str+slen, buf, '\0', size-slen))
|
||||
(str+slen)[size-slen - 1] = '\0';
|
||||
}
|
||||
|
||||
return 1; /* ok */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue