diff options
Autocommit at 08.05.2022 @ 10:13
3 files changed, 3 insertions, 3 deletions
| -rw-r--r-- | src/Generic/Date/Date.cpp | 2 | ||||
| -rw-r--r-- | src/Generic/Date/Date.h | 2 | ||||
| -rw-r--r-- | src/Generic/String/String.cpp | 2 |
diff --git a/src/Generic/Date/Date.cpp b/src/Generic/Date/Date.cpp index db2551a..0507b21 100644 --- a/src/Generic/Date/Date.cpp +++ b/src/Generic/Date/Date.cpp @@ -70,7 +70,7 @@ int digitToChar(unsigned digit) { return ' '; } -String Date::createCStr() { +String Date::createString() const { String out; return ((((out += day) += ".") += month) += ".") += year; } diff --git a/src/Generic/Date/Date.h b/src/Generic/Date/Date.h index a960678..78aca2e 100644 --- a/src/Generic/Date/Date.h +++ b/src/Generic/Date/Date.h @@ -25,7 +25,7 @@ public: unsigned short get_year() const; bool set_year(unsigned short year); - String createCStr(); + String createString() const; void read(std::istream& istr); void write(std::ostream& ostr); diff --git a/src/Generic/String/String.cpp b/src/Generic/String/String.cpp index 251ba0a..eb157a2 100644 --- a/src/Generic/String/String.cpp +++ b/src/Generic/String/String.cpp @@ -52,7 +52,7 @@ String& String::operator+=(unsigned number) { unsigned tempLen = number / 10 + 1; char* tmp = new char[tempLen + 1]; tmp[tempLen] = '\0'; - for (unsigned i = tempLen - 1; i >= 0; i--, number /= 10) + for (unsigned i = tempLen - 1; i < tempLen; i--, number /= 10) tmp[i] = number % 10 + '0'; *this += tmp; |
