]> git.lizzy.rs Git - linenoise.git/commitdiff
Tabs not inserted as control characters
authorSteve Bennett <steveb@workware.net.au>
Sun, 25 Sep 2011 21:34:10 +0000 (07:34 +1000)
committerSteve Bennett <steveb@workware.net.au>
Sun, 25 Sep 2011 21:34:10 +0000 (07:34 +1000)
Due to missing parens in non-utf8 version of utf8_strlen()

Reported-by: Karl Robillard <krobillard@san.rr.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
utf8.h

diff --git a/utf8.h b/utf8.h
index 11dc51bd4237c0d10574ac32f6a940ce14be7dc4..9537939876ae091451500330b488485f740361f7 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -12,7 +12,7 @@
 #include <ctype.h>
 
 /* No utf-8 support. 1 byte = 1 char */
-#define utf8_strlen(S, B) (B) < 0 ? (int)strlen(S) : (B)
+#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