Date: Thu, 5 Jun 2003 03:30:09 -0700 (PDT) From: Dmitry Sivachenko <mitya@demos.su> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/52960: kbdcontrol macros don't work when len% Message-ID: <200306051030.h55AU9or018018@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/52960; it has been noted by GNATS. From: Dmitry Sivachenko <mitya@demos.su> To: freebsd-gnats-submit@FreeBSD.org Cc: mat@hak.cnd.mcgill.ca Subject: Re: kern/52960: kbdcontrol macros don't work when len% Date: Thu, 5 Jun 2003 14:24:50 +0400 The following patch fixes the problem. When you supply exactly MAXFK(=16) chararacters as a macro, you should use strncpy which does not append trailing '\0'. --- kbdcontrol.c.orig Thu Jun 5 14:19:13 2003 +++ kbdcontrol.c Thu Jun 5 14:17:52 2003 @@ -848,7 +848,7 @@ fkey.flen, MAXFK); return; } - strcpy(fkey.keydef, string); + strncpy(fkey.keydef, string, MAXFK); fkey.keynum -= 1; if (ioctl(0, SETFKEY, &fkey) < 0) warn("setting function key");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306051030.h55AU9or018018>