From 37a0f3914b3bc747360ae8c47a789612b9ddba0c Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 9 Aug 2004 04:27:58 +0000 Subject: [PATCH] fix bug which prevented programming function keys that were exactly 16 characters long.. strcpy was coping over the length... PR: 52960 Submitted by: Dmitry Sivachenko MFC after: 1 week --- usr.sbin/kbdcontrol/kbdcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 0f2ad2171326..eb72b825b835 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -893,7 +893,7 @@ set_functionkey(char *keynumstr, char *string) 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");