From 74b98d1a1cf13d4e08be363b475b993eeaf52be9 Mon Sep 17 00:00:00 2001 From: Piotr Wilczynski Date: Sat, 10 Apr 2021 14:38:29 +0200 Subject: [PATCH] add comment for remove of null string --- src/TTrigger.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TTrigger.cpp b/src/TTrigger.cpp index b1e779fcc73..5185112291f 100755 --- a/src/TTrigger.cpp +++ b/src/TTrigger.cpp @@ -356,6 +356,7 @@ bool TTrigger::match_perl(char* subject, const QString& toMatch, int regexNumber char* tabptr = reinterpret_cast(name_table); for (i = 0; i < namecount; i++) { int n = (tabptr[0] << 8) | tabptr[1]; + // Trim doesn't remove null character at the end of name that sometimes shows up auto name = QString::fromUtf8(tabptr + 2, name_entry_size - 3).trimmed().remove(QStringLiteral("\u0000")); char* substring_start = subject + ovector[2*n]; int substring_length = ovector[2*n+1] - ovector[2*n];