summaryrefslogtreecommitdiff
path: root/editors/mg/patches/patch-ad
blob: 5fb66ef8034acedcd0fb79e1f8499691e8d1536d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ad,v 1.4 2014/07/07 18:06:58 jperkin Exp $

- use toupper() correctly
- suppress initialization warning that sometimes (?) arises with gcc 4.5
- include limits.h for INT_{MIN,MAX}

--- extend.c.orig	2011-06-18 09:18:54.000000000 +0000
+++ extend.c
@@ -12,6 +12,7 @@
 
 #include <sys/types.h>
 #include <ctype.h>
+#include <limits.h>
 
 #ifndef NO_MACRO
 #include "macro.h"
@@ -445,7 +446,7 @@ dobindkey(KEYMAP *map, const char *func,
 	for (i = 0; *str && i < MAXKEY; i++) {
 		/* XXX - convert numbers w/ strol()? */
 		if (*str == '^' && *(str + 1) !=  '\0') {
-			key.k_chars[i] = CCHR(toupper(*++str));
+			key.k_chars[i] = CCHR(toupper((unsigned char)*++str));
 		} else if (*str == '\\' && *(str + 1) != '\0') {
 			switch (*++str) {
 			case '^':