From 6e6d732bac3c21cb85f8e998908f9b393630e5f8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 28 Oct 2011 21:18:46 -0700 Subject: 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 Reviewed-by: Jeremy Huddleston --- hw/xfree86/common/xf86Xinput.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hw/xfree86/common/xf86Xinput.c') 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; -- cgit v1.2.3