diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-10-28 21:18:46 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-23 12:15:05 -0800 |
commit | 6e6d732bac3c21cb85f8e998908f9b393630e5f8 (patch) | |
tree | be0fb5e9e8f4e10af141e061f35e6f62b06d3181 /hw/xfree86/common/xf86Xinput.c | |
parent | e189dbb3e57d30eb96034d4ce9544ce7a93a371e (diff) |
Convert strncpy/strncat to strlcpy/strlcat
As long as we're carrying around a compatibility copy in os/strl*.c,
might as well use them.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw/xfree86/common/xf86Xinput.c')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 7feb48c1e..b9753f01d 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -460,10 +460,9 @@ HostOS(void) if (*host_os == '\0') { if (uname(&name) >= 0) - strcpy(host_os, name.sysname); + strlcpy(host_os, name.sysname, sizeof(host_os)); else { - strncpy(host_os, "unknown", sizeof(host_os)); - host_os[sizeof(host_os)-1] = '\0'; + strlcpy(host_os, "unknown", sizeof(host_os)); } } return host_os; |