Skip to content

Commit

Permalink
Closed beta 1001007003: Fix build for old OS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jun 30, 2017
1 parent c3db57a commit 67f2daa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Telegram/SourceFiles/lang/lang_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class ValueParser {

bool _failed = true;

const char *_begin, *_ch, *_end;
const char *_begin = nullptr;
const char *_ch = nullptr;
const char *_end = nullptr;

QString _result;
OrderedSet<ushort> _tagsUsed;
Expand All @@ -69,6 +71,7 @@ class ValueParser {
ValueParser::ValueParser(const QByteArray &key, LangKey keyIndex, const QByteArray &value)
: _key(key)
, _keyIndex(keyIndex)
, _currentTag("")
, _begin(value.constData())
, _ch(_begin)
, _end(_begin + value.size()) {
Expand Down Expand Up @@ -146,7 +149,7 @@ bool ValueParser::parse() {
_result.append(_currentTagReplacer);

_begin = _ch + 1;
_currentTag = QLatin1String();
_currentTag = QLatin1String("");
}
}
appendToResult(_end);
Expand Down
8 changes: 4 additions & 4 deletions Telegram/SourceFiles/mtproto/special_config_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,21 @@ void SpecialConfigRequest::dnsFinished() {
auto answerIt = response.find(qsl("Answer"));
if (answerIt == response.constEnd()) {
LOG(("Config Error: Could not find Answer in dns response JSON."));
} else if (!answerIt->isArray()) {
} else if (!(*answerIt).isArray()) {
LOG(("Config Error: Not an array received in Answer in dns response JSON."));
} else {
for (auto elem : answerIt->toArray()) {
for (auto elem : (*answerIt).toArray()) {
if (!elem.isObject()) {
LOG(("Config Error: Not an object found in Answer array in dns response JSON."));
} else {
auto object = elem.toObject();
auto dataIt = object.find(qsl("data"));
if (dataIt == object.constEnd()) {
LOG(("Config Error: Could not find data in Answer array entry in dns response JSON."));
} else if (!dataIt->isString()) {
} else if (!(*dataIt).isString()) {
LOG(("Config Error: Not a string data found in Answer array entry in dns response JSON."));
} else {
auto data = dataIt->toString();
auto data = (*dataIt).toString();
entries.insertMulti(INT_MAX - data.size(), data);
}
}
Expand Down

0 comments on commit 67f2daa

Please sign in to comment.