From 0653789d69df51291414dbc4ae65db30c2eb63d1 Mon Sep 17 00:00:00 2001 From: phintuka Date: Thu, 13 Nov 2008 10:50:10 +0000 Subject: Eliminated strn0cpy --- xine_frontend_lirc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xine_frontend_lirc.c b/xine_frontend_lirc.c index 21e7b090..84f752d6 100644 --- a/xine_frontend_lirc.c +++ b/xine_frontend_lirc.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_frontend_lirc.c,v 1.15 2008-11-11 00:02:33 phintuka Exp $ + * $Id: xine_frontend_lirc.c,v 1.16 2008-11-13 10:50:10 phintuka Exp $ * */ /* @@ -81,7 +81,8 @@ static void lircd_connect(void) } addr.sun_family = AF_UNIX; - strn0cpy(addr.sun_path, (char*)lirc_device_name, sizeof(addr.sun_path)); + strncpy(addr.sun_path, (char*)lirc_device_name, sizeof(addr.sun_path)); + addr.sun_path[sizeof(addr.sun_path)-1] = 0; if ((fd_lirc = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { LOGERR("lirc error: socket() < 0"); -- cgit v1.2.3