]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
don't pass 0 time_t to Borland localtime(), it crashes (bug 1704438); also check...
[wxWidgets.git] / include / wx / string.h
index 9b4741250bd5ea54bebb54d50d39ca6d5ee90362..07e7e86992f4aa4223eb9d1d9c58e52c63e15d23 100644 (file)
@@ -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];
 }
 
 // ----------------------------------------------------------------------------