From b2db94675b1881ab40f2e6c625f716f79e1efcc4 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 28 Sep 2015 10:36:17 +0200 Subject: Fix incorrect std::string::operator[] usage Passing a position equal to length() to the non-const version of operator[] is undefined --- src/modules/m_check.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/m_check.cpp') diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 9c5c414f1..5063368b8 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -174,7 +174,7 @@ class CommandCheck : public Command /* /check on a channel */ user->SendText(checkstr + " timestamp " + timestring(targchan->age)); - if (targchan->topic[0] != 0) + if (!targchan->topic.empty()) { /* there is a topic, assume topic related information exists */ user->SendText(checkstr + " topic " + targchan->topic); -- cgit v1.2.3