aboutsummaryrefslogtreecommitdiff
path: root/src/MessageComposer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MessageComposer.cpp')
-rw-r--r--src/MessageComposer.cpp8
1 files changed, 4 insertions, 4 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: