From 54d35230df8e89277ece36c708f4be5179c29115 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 12 Jul 2016 19:59:03 +0200 Subject: [PATCH] Don't use UTF-strlen() if the text is not UTF --- Marlin/ultralcd.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b39617c15..267fc213a 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2481,7 +2481,11 @@ void lcd_init() { int lcd_strlen(const char* s) { int i = 0, j = 0; while (s[i]) { - if ((s[i] & 0xc0) != 0x80) j++; + #ifdef MAPPER_NON + j++; + #else + if ((s[i] & 0xc0) != 0x80) j++; + #endif i++; } return j; @@ -2490,7 +2494,11 @@ int lcd_strlen(const char* s) { int lcd_strlen_P(const char* s) { int j = 0; while (pgm_read_byte(s)) { - if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; + #ifdef MAPPER_NON + j++; + #else + if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; + #endif s++; } return j;