From 706015ab8599006931bdedf55f8865261e131ac8 Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Tue, 27 Mar 2018 21:24:32 +0300 Subject: [PATCH] Remove some unreachable code --- src/display_chat_manager.cpp | 9 --------- src/help/help_impl.cpp | 17 +---------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/display_chat_manager.cpp b/src/display_chat_manager.cpp index 4825e7856ee..971636710bd 100644 --- a/src/display_chat_manager.cpp +++ b/src/display_chat_manager.cpp @@ -100,15 +100,6 @@ void display_chat_manager::add_chat_message(const time_t& time, const std::strin msg = message; } - try { - // We've had a joker who send an invalid utf-8 message to crash clients - // so now catch the exception and ignore the message. - //msg = my_disp_.video().faked() ? "" : font::word_wrap_text(msg,font::SIZE_NORMAL,my_disp_.map_outside_area().w*3/4); - } catch (utf8::invalid_utf8_exception&) { - ERR_NG << "Invalid utf-8 found, chat message is ignored." << std::endl; - return; - } - int ypos = chat_message_x; for(std::vector::const_iterator m = chat_messages_.begin(); m != chat_messages_.end(); ++m) { ypos += std::max(font::get_floating_label_rect(m->handle).h, diff --git a/src/help/help_impl.cpp b/src/help/help_impl.cpp index 2b83549fa9e..33ff9351c77 100644 --- a/src/help/help_impl.cpp +++ b/src/help/help_impl.cpp @@ -1327,22 +1327,7 @@ color_t string_to_color(const std::string &cmp_str) std::vector split_in_width(const std::string &/*s*/, const int /*font_size*/, const unsigned /*width*/) { - std::vector res; - try { -#if 0 - const std::string& first_line = font::word_wrap_text(s, font_size, width, -1, 1, true); - res.push_back(first_line); - if(s.size() > first_line.size()) { - res.push_back(s.substr(first_line.size())); - } -#endif - } - catch (utf8::invalid_utf8_exception&) - { - throw parse_error (_("corrupted original file")); - } - - return res; + return {}; } std::string remove_first_space(const std::string& text)