[apps/calculations] Resolve bug in ring buffer

Change-Id: I1e34530f0e257e5e6a04c4ce974461888279b486
This commit is contained in:
Émilie Feral
2017-05-29 15:57:16 +02:00
parent 59eb97a3fe
commit 6b136d8378
4 changed files with 48 additions and 17 deletions

View File

@@ -31,6 +31,15 @@ Calculation::~Calculation() {
}
}
Calculation& Calculation::operator=(const Calculation& other) {
const char * otherInputText = other.m_inputText;
const char * otherOutputText = other.m_outputText;
reset();
strlcpy(m_inputText, otherInputText, sizeof(m_inputText));
strlcpy(m_outputText, otherOutputText, sizeof(m_outputText));
return *this;
}
void Calculation::reset() {
m_inputText[0] = 0;
m_outputText[0] = 0;