From c13a7d85a37d29f9adeca048a27b2f4528f635cd Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 8 May 2022 09:13:10 +0300 Subject: Autocommit at 08.05.2022 @ 09:13 --- src/Services/EventService.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Services/EventService.cpp') 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; } -- cgit v1.3.1-23-gd82d