mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Fix crash in markdown preprocessing.
This commit is contained in:
@@ -426,10 +426,11 @@ private:
|
||||
int newlinePosition(const QString &text, int offset) const {
|
||||
const auto length = text.size();
|
||||
if (offset < length) {
|
||||
auto ch = text.data() + offset;
|
||||
for (const auto e = ch + length; ch != e; ++ch) {
|
||||
const auto begin = text.data();
|
||||
const auto end = begin + length;
|
||||
for (auto ch = begin + offset; ch != end; ++ch) {
|
||||
if (IsNewline(*ch)) {
|
||||
return (ch - text.data());
|
||||
return (ch - begin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user