]> git.lizzy.rs Git - linenoise.git/blobdiff - utf8.h
Tabs not inserted as control characters
[linenoise.git] / utf8.h
diff --git a/utf8.h b/utf8.h
index 564d64e45d989aa9ec5b1801831fb3c7926acf97..9537939876ae091451500330b488485f740361f7 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -12,8 +12,8 @@
 #include <ctype.h>
 
 /* No utf-8 support. 1 byte = 1 char */
-#define utf8_strlen(S, B) (B) < 0 ? (int)strlen(S) : (B)
-#define utf8_tounicode(S, CP) (*(CP) = *(S), 1)
+#define utf8_strlen(S, B) ((B) < 0 ? (int)strlen(S) : (B))
+#define utf8_tounicode(S, CP) (*(CP) = (unsigned char)*(S), 1)
 #define utf8_index(C, I) (I)
 #define utf8_charlen(C) 1