diff options
Diffstat (limited to 'usr.sbin/pkg_install/lib/str.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/str.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.sbin/pkg_install/lib/str.c b/usr.sbin/pkg_install/lib/str.c index c5f11a2..55ff782 100644 --- a/usr.sbin/pkg_install/lib/str.c +++ b/usr.sbin/pkg_install/lib/str.c @@ -61,6 +61,20 @@ get_dash_string(char **str) return *str; } +/* Do a strlcpy and test for overflow */ +int +s_strlcpy(char *dst, const char *src, size_t size) +{ + return (strlcpy(dst, src, size) >= size); +} + +/* Do a strlcat and test for overflow */ +int +s_strlcat(char *dst, const char *src, size_t size) +{ + return (strlcat(dst, src, size) >= size); +} + /* Rather Obvious */ char * copy_string(char *str) |