From 39f8b9a33309b48e82b13175854c9175136c2274 Mon Sep 17 00:00:00 2001 From: lensferno Date: Wed, 6 Apr 2022 12:14:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=89=E4=B8=AA=E8=99=AB=EF=BC=9A=E4=B8=8B?= =?UTF-8?q?=E6=A0=87=E8=BF=90=E7=AE=97=E7=AC=A6=E5=8F=82=E6=95=B0=E8=B6=8A?= =?UTF-8?q?=E7=95=8C=E6=9C=AA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- work20220401/neoString/CString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/work20220401/neoString/CString.cpp b/work20220401/neoString/CString.cpp index fe4327e..af97eda 100644 --- a/work20220401/neoString/CString.cpp +++ b/work20220401/neoString/CString.cpp @@ -149,5 +149,5 @@ std::istream &operator>>(std::istream &inputStream, const CString &source) { } char CString::operator[](const int i) const { - return data[i]; + return (i < MAX_LENGTH) ? data[i] : '\0'; } \ No newline at end of file