diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-01-24 22:15:21 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-19 00:14:40 +0200 |
commit | d525a7ac28dd6403e46e8df6fa15b723b8c09503 (patch) | |
tree | 51254e6e94bb099484c2d2c01fa4f397c4e70287 /src | |
parent | b629e93b124fcad6635a508e47c7776bb0891d1b (diff) |
Add more tests, add apache license
Diffstat (limited to 'src')
-rw-r--r-- | src/MessageComposer.cpp | 8 | ||||
-rw-r--r-- | src/Window.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/MessageComposer.cpp b/src/MessageComposer.cpp index 56ff925..3ff0d76 100644 --- a/src/MessageComposer.cpp +++ b/src/MessageComposer.cpp @@ -33,7 +33,6 @@ namespace dchat EnclosedType parseEnclosedData(char endSymbol) { - ++index; bool foundEndOfType = false; while(index < length) @@ -47,7 +46,7 @@ namespace dchat } } - if(!foundEndOfType || index == length) + if(!foundEndOfType) return EnclosedType::TEXT; return EnclosedType::DATA; @@ -62,6 +61,7 @@ namespace dchat if(c == '[') { usize start = index; + ++index; if(parseEnclosedData(']') == EnclosedType::TEXT) { identifierRange.start = start; @@ -69,8 +69,7 @@ namespace dchat return Token::TEXT; } - c = getChar(); - if(c != '(') + if(index == length || getChar() != '(') { identifierRange.start = start; identifierRange.end = index; @@ -81,6 +80,7 @@ namespace dchat typeRange.end = index - 1; typeDataRange.start = index + 1; + ++index; switch(parseEnclosedData(')')) { case EnclosedType::TEXT: diff --git a/src/Window.cpp b/src/Window.cpp index 8a6652e..1344429 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -272,7 +272,7 @@ namespace dchat } prevTimeMillis = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count() - 5000; //drawBackgroundConnection = signal_draw().connect(sigc::mem_fun(*this, &Window::drawBackground)); - //set_size_request(640, 480); + set_size_request(640, 480); //set_app_paintable(true); } |