Please sign in to comment.
Move strlcat, strlcpy, and strnlen
Move strlcat() and strlcpy() from .c source files in to the libspl string.h header. By changing these compatibily functions to static inlines they can included as needed without requiring linking with the libspl.so library. Remove strnlen() which is barely used in the source, and has been provided by glibc since v2.10. Finally, convert four instances of strnlen() to strlcpy() in libzfs_input_check.c which were causing build warning when compiling with gcc 8.2.1. For example: libzfs_input_check.c: In function ‘zfs_destroy’: libzfs_input_check.c:651:9: error: ‘strncpy’ specified bound \ 4096 equals destination size [-Werror=stringop-truncation] (void) strncpy(zc.zc_name, dataset, sizeof (zc.zc_name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Brian Behlendorf <firstname.lastname@example.org>
- Loading branch information...
Showing with 54 additions and 162 deletions.