aboutsummaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-09-14 08:31:59 +1000
committerSteve Bennett <steveb@workware.net.au>2011-09-14 09:03:12 +1000
commita758f8cefaa38292fa91e8bf7a097a5341edd3c5 (patch)
tree5bd5e02a5be9a464b7f4fa07be48ae5e3bfe3ce5 /utf8.h
parent69bfcb89ff30d027911688f66f085db48b9f74d9 (diff)
downloadjimtcl-a758f8cefaa38292fa91e8bf7a097a5341edd3c5.zip
jimtcl-a758f8cefaa38292fa91e8bf7a097a5341edd3c5.tar.gz
jimtcl-a758f8cefaa38292fa91e8bf7a097a5341edd3c5.tar.bz2
Minor linenoise improvements
From github: - CHA is 1-based - Added some casts to make it easier to include in a c++ - const correctness - chars are unsigned if not utf-8
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/utf8.h b/utf8.h
index 786b13f..dfb8b08 100644
--- a/utf8.h
+++ b/utf8.h
@@ -22,7 +22,7 @@ int utf8_fromunicode(char *p, unsigned short uc);
/* No utf-8 support. 1 byte = 1 char */
#define utf8_strlen(S, B) (B) < 0 ? strlen(S) : (B)
-#define utf8_tounicode(S, CP) (*(CP) = *(S), 1)
+#define utf8_tounicode(S, CP) (*(CP) = (unsigned char)*(S), 1)
#define utf8_upper(C) toupper(C)
#define utf8_lower(C) tolower(C)
#define utf8_index(C, I) (I)