Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services / EventService.cpp
diff options
context:
space:
mode:
Commitc13a7d85a37d29f9adeca048a27b2f4528f635cd (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-08 09:13:10 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-08 09:13:10 +0300
Filesc7f5227c6ad4e6dd6b91ec28bb20a1cf249c770f /src/Services/EventService.cpp
FMI-OOP-P1_TicketSystem-c13a7d85a37d29f9adeca048a27b2f4528f635cd.tar
FMI-OOP-P1_TicketSystem-c13a7d85a37d29f9adeca048a27b2f4528f635cd.tar.gz
FMI-OOP-P1_TicketSystem-c13a7d85a37d29f9adeca048a27b2f4528f635cd.zip
Parentfe55f1c597beb21e2aa127d89437e0eaba3ff328 (diff)
Autocommit at 08.05.2022 @ 09:13
1 files changed, 1 insertions, 2 deletions
-rw-r--r--src/Services/EventService.cpp3
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index 6388a1e..5adbf6b 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -142,7 +142,7 @@ String EventService::createSeatingString(const char* name, const Date& date, uns
unsigned rowCount = events[eInd].get_hall().get_rows(), seatsCount = events[eInd].get_hall().get_seatsPerRow();
*seatsPerRow = seatsCount;
- String out = new char[rowCount * seatsCount + 1];
+ String out(rowCount * seatsCount);
for (unsigned acc = 0, row = 1; row <= rowCount; row++) {
for (unsigned seat = 1; seat <= seatsCount; seat++, acc++) {
@@ -155,7 +155,6 @@ String EventService::createSeatingString(const char* name, const Date& date, uns
}
}
- out[seatsCount * rowCount] = '\0';
return out;
}