[poincare] Regression and Series symbols must be 2 characters long

This commit is contained in:
Léa Saviot
2018-11-06 12:08:23 +01:00
committed by Émilie Feral
parent ad1629721d
commit 5f8c71898a

View File

@@ -136,7 +136,7 @@ Symbol::Symbol(char name) : Symbol(&name, 1) {}
bool Symbol::isSeriesSymbol(const char * c) {
// [NV][1-3]
if ((c[0] == 'N' || c[0] == 'V') && c[1] >= '1' && c[1] <= '3') {
if (c[2] == 0 && (c[0] == 'N' || c[0] == 'V') && c[1] >= '1' && c[1] <= '3') {
return true;
}
return false;
@@ -144,7 +144,7 @@ bool Symbol::isSeriesSymbol(const char * c) {
bool Symbol::isRegressionSymbol(const char * c) {
// [XY][1-3]
if ((c[0] == 'X' || c[0] == 'Y') && c[1] >= '1' && c[1] <= '3') {
if (c[2] == 0 && (c[0] == 'X' || c[0] == 'Y') && c[1] >= '1' && c[1] <= '3') {
return true;
}
return false;