]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use strlcpy() in favor of strncpy() as it's defined to have a nul character
authordelphij <delphij@FreeBSD.org>
Fri, 11 Sep 2015 06:52:57 +0000 (06:52 +0000)
committerdelphij <delphij@FreeBSD.org>
Fri, 11 Sep 2015 06:52:57 +0000 (06:52 +0000)
commit85e8cd93390eb0f4ee5d7d6ac6b9c1e55f7cee83
treeabbb73b2bb4dcc8cd757e5bcfa968d74ef5258b0
parent65d9a559eb7b19c7541531c4e8891e6d45b00ff2
Use strlcpy() in favor of strncpy() as it's defined to have a nul character
at the end of string buffer, and the code context do expects this to behave
correctly (e.g. strchr).

Note that we do not believe there is real-world impact for gstat(8)'s usage
because the strings are length checked, and the on-stack buffer belongs to
main() and we can expect to have zeros in them.

MFC after: 2 weeks
usr.sbin/gstat/gstat.c