diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-11-14 10:01:14 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2022-11-15 00:56:01 -0400 |
commit | b25a9d8f99b75570d18ea64602de7fe48da612d6 (patch) | |
tree | f9d4217317e9a6e44d79e6fbf4fcbf7355932f93 /apps/debug_menu.c | |
parent | 034b6d5bfb5bdedaf843079a02ff6df31488f394 (diff) | |
download | rockbox-b25a9d8f99b75570d18ea64602de7fe48da612d6.tar.gz rockbox-b25a9d8f99b75570d18ea64602de7fe48da612d6.zip |
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
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 87a41920b9..0b0bc8fc2b 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1627,7 +1627,9 @@ static int ata_smart_attr_to_string( | |||
1627 | if (len >= name_sz) len = name_sz-1; | 1627 | if (len >= name_sz) len = name_sz-1; |
1628 | slen += len; | 1628 | slen += len; |
1629 | } | 1629 | } |
1630 | snprintf(str+slen, size-slen, "%s", buf); | 1630 | |
1631 | if (!memccpy (str+slen, buf, '\0', size-slen)) | ||
1632 | (str+slen)[size-slen - 1] = '\0'; | ||
1631 | } | 1633 | } |
1632 | 1634 | ||
1633 | return 1; /* ok */ | 1635 | return 1; /* ok */ |