diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-05-23 23:29:49 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-05-23 23:29:49 +0000 |
commit | e7a62e8b70512d812cef6b70fd4e322f433d557b (patch) | |
tree | 88b8cc78f626da6c454f8d1c617cf0100bb0a50a /usr.bin/mg/kbd.c | |
parent | db83c7d6226b74232b49ac18d7337c50194f21be (diff) |
cinfo is const, keyname() and findbind() take buffer size to use strlcpy vs cpy+len
Diffstat (limited to 'usr.bin/mg/kbd.c')
-rw-r--r-- | usr.bin/mg/kbd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mg/kbd.c b/usr.bin/mg/kbd.c index 4d733cb0516..87772f9eebc 100644 --- a/usr.bin/mg/kbd.c +++ b/usr.bin/mg/kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kbd.c,v 1.8 2001/05/23 22:20:35 art Exp $ */ +/* $OpenBSD: kbd.c,v 1.9 2001/05/23 23:29:48 mickey Exp $ */ /* * Terminal independent keyboard handling. @@ -21,7 +21,7 @@ #ifndef NO_DPROMPT #define PROMPTL 80 -char prompt[PROMPTL], *promptp; +char prompt[PROMPTL] = "", *promptp = prompt; #endif /* !NO_DPROMPT */ static int use_metakey = TRUE; @@ -117,7 +117,8 @@ getkey(flag) #endif /* DO_METAKEY */ #ifndef NO_DPROMPT if (flag && promptp < &prompt[PROMPTL - 5]) { - promptp = keyname(promptp, c); + promptp = keyname(promptp, + sizeof(prompt) - (promptp - prompt) - 1, c); *promptp++ = '-'; *promptp = '\0'; } |