summaryrefslogtreecommitdiff
path: root/usr.bin/vi/cl
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2016-05-27 09:18:13 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2016-05-27 09:18:13 +0000
commitb7a801368cabd897097c56917dc314dab493a361 (patch)
tree36d074d01f9baebfcab901d5af9aa056d3e19a84 /usr.bin/vi/cl
parent3e1124df121ad7546b99de5ff16aef9aeeeca556 (diff)
Revert CHAR_T removal. Some signedness flaws were introduced.
Found the hard way by jca@
Diffstat (limited to 'usr.bin/vi/cl')
-rw-r--r--usr.bin/vi/cl/cl.h4
-rw-r--r--usr.bin/vi/cl/cl_funcs.c6
-rw-r--r--usr.bin/vi/cl/cl_read.c6
-rw-r--r--usr.bin/vi/cl/cl_term.c10
4 files changed, 13 insertions, 13 deletions
diff --git a/usr.bin/vi/cl/cl.h b/usr.bin/vi/cl/cl.h
index 4bb991b2a6f..5e5cdcb614c 100644
--- a/usr.bin/vi/cl/cl.h
+++ b/usr.bin/vi/cl/cl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.h,v 1.9 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl.h,v 1.10 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -12,7 +12,7 @@
*/
typedef struct _cl_private {
- char ibuf[256]; /* Input keys. */
+ CHAR_T ibuf[256]; /* Input keys. */
int eof_count; /* EOF count. */
diff --git a/usr.bin/vi/cl/cl_funcs.c b/usr.bin/vi/cl/cl_funcs.c
index cb40374b462..4daa75e4360 100644
--- a/usr.bin/vi/cl/cl_funcs.c
+++ b/usr.bin/vi/cl/cl_funcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_funcs.c,v 1.19 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_funcs.c,v 1.20 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -370,10 +370,10 @@ cl_insertln(SCR *sp)
* cl_keyval --
* Return the value for a special key.
*
- * PUBLIC: int cl_keyval(SCR *, scr_keyval_t, unsigned char *, int *);
+ * PUBLIC: int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *);
*/
int
-cl_keyval(SCR *sp, scr_keyval_t val, unsigned char *chp, int *dnep)
+cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep)
{
CL_PRIVATE *clp;
diff --git a/usr.bin/vi/cl/cl_read.c b/usr.bin/vi/cl/cl_read.c
index fd2fc04de5e..3644684b65f 100644
--- a/usr.bin/vi/cl/cl_read.c
+++ b/usr.bin/vi/cl/cl_read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_read.c,v 1.20 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_read.c,v 1.21 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -32,7 +32,7 @@
#include "cl.h"
static input_t cl_read(SCR *,
- u_int32_t, char *, size_t, int *, struct timeval *);
+ u_int32_t, CHAR_T *, size_t, int *, struct timeval *);
static int cl_resize(SCR *, size_t, size_t);
/*
@@ -123,7 +123,7 @@ retest: if (LF_ISSET(EC_INTERRUPT) || F_ISSET(clp, CL_SIGINT)) {
* Read characters from the input.
*/
static input_t
-cl_read(SCR *sp, u_int32_t flags, char *bp, size_t blen, int *nrp,
+cl_read(SCR *sp, u_int32_t flags, CHAR_T *bp, size_t blen, int *nrp,
struct timeval *tp)
{
struct termios term1, term2;
diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c
index ee4cd32294b..7e0c7971b1d 100644
--- a/usr.bin/vi/cl/cl_term.c
+++ b/usr.bin/vi/cl/cl_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_term.c,v 1.24 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_term.c,v 1.25 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -30,7 +30,7 @@
#include "../common/common.h"
#include "cl.h"
-static int cl_pfmap(SCR *, seq_t, char *, size_t, char *, size_t);
+static int cl_pfmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
/*
* XXX
@@ -152,10 +152,10 @@ cl_term_end(GS *gp)
* cl_fmap --
* Map a function key.
*
- * PUBLIC: int cl_fmap(SCR *, seq_t, char *, size_t, char *, size_t);
+ * PUBLIC: int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
*/
int
-cl_fmap(SCR *sp, seq_t stype, char *from, size_t flen, char *to,
+cl_fmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to,
size_t tlen)
{
/* Ignore until the screen is running, do the real work then. */
@@ -172,7 +172,7 @@ cl_fmap(SCR *sp, seq_t stype, char *from, size_t flen, char *to,
* Map a function key (private version).
*/
static int
-cl_pfmap(SCR *sp, seq_t stype, char *from, size_t flen, char *to,
+cl_pfmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to,
size_t tlen)
{
size_t nlen;