From 378964d49d7e3c5b7a79e9cae1115d999c3b9d28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 19 Apr 2007 18:33:35 +0000 Subject: [PATCH] fixed wxCStrData::operator[] to use wxString::operator[] instead of at() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/wx/string.h b/include/wx/string.h index 9b4741250b..07e7e86992 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -2612,7 +2612,9 @@ inline wxUniChar wxCStrData::operator*() const inline wxUniChar wxCStrData::operator[](size_t n) const { - return m_str->at(m_offset + n); + // NB: we intentionally use operator[] and not at() here because the former + // works for the terminating NUL while the latter does not + return (*m_str)[m_offset + n]; } // ---------------------------------------------------------------------------- -- 2.50.0