From cb9b0e5ee455fd615338baf828fd3ea8a541b395 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sat, 31 Aug 2002 16:41:35 +0000 Subject: (cmd_bind): malloc the correct amount of memory for keydesc (cmd_unbind): likewise --- ChangeLog | 5 +++++ src/actions.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55781f1..4289a3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-08-31 Shawn Betts + + * src/actions.c (cmd_bind): malloc the correct amount of memory for keydesc + (cmd_unbind): likewise + 2002-07-28 Shawn Betts * src/main.c (handler): do not report badwindow errors if diff --git a/src/actions.c b/src/actions.c index 875c235..4fcd0e4 100644 --- a/src/actions.c +++ b/src/actions.c @@ -452,7 +452,7 @@ cmd_bind (int interactive, void *data) return NULL; } - keydesc = (char*) xmalloc (strlen (data + 1)); + keydesc = (char*) xmalloc (strlen (data) + 1); sscanf (data, "%s", keydesc); cmd = data + strlen (keydesc); @@ -506,7 +506,7 @@ cmd_unbind (int interactive, void *data) return NULL; } - keydesc = (char*) xmalloc (strlen (data + 1)); + keydesc = (char*) xmalloc (strlen (data) + 1); sscanf (data, "%s", keydesc); key = parse_keydesc (keydesc); -- cgit v1.2.3