[chronojump/michrolab] Fixed totalPersons miscountinig in addPerson
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump/michrolab] Fixed totalPersons miscountinig in addPerson
- Date: Fri, 27 May 2022 15:02:50 +0000 (UTC)
commit 171d3434927d2d94d7f69c22fc70038df3038bdc
Author: xpadulles <x padulles gmail com>
Date: Fri May 27 13:25:36 2022 +0200
Fixed totalPersons miscountinig in addPerson
arduino/michrolab/michrolab.ino | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/arduino/michrolab/michrolab.ino b/arduino/michrolab/michrolab.ino
index 72356d37a..09ea91aed 100644
--- a/arduino/michrolab/michrolab.ino
+++ b/arduino/michrolab/michrolab.ino
@@ -1752,12 +1752,10 @@ void addPerson(String row)
currentPerson = row.substring(prevComaIndex + 1, nextComaIndex).toInt();
persons[currentPerson].index = currentPerson;
- if (currentPerson >= totalPersons) totalPersons = currentPerson;
-
+ if (currentPerson >= totalPersons) totalPersons = currentPerson+1;
prevComaIndex = nextComaIndex;
nextComaIndex = row.indexOf(",", prevComaIndex + 1 );
persons[currentPerson].name = row.substring(prevComaIndex + 1 , nextComaIndex);
-
prevComaIndex = nextComaIndex;
nextComaIndex = row.indexOf(",", prevComaIndex + 1 );
persons[currentPerson].surname = row.substring(prevComaIndex + 1 , nextComaIndex);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]