Changeset 75008 in vbox
- Timestamp:
- Oct 23, 2018 4:08:44 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 126040
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/ministring.h
r74262 r75008 244 244 void reserve(size_t cb) 245 245 { 246 if ( cb != m_cbAllocated 247 && cb > m_cch + 1 248 ) 246 if ( ( cb != m_cbAllocated 247 && cb > m_cch + 1) 248 || ( m_psz == NULL 249 && cb > 0)) 249 250 { 250 251 int rc = RTStrRealloc(&m_psz, cb); … … 266 267 int reserveNoThrow(size_t cb) RT_NOEXCEPT 267 268 { 268 if ( cb != m_cbAllocated 269 && cb > m_cch + 1 270 ) 269 if ( ( cb != m_cbAllocated 270 && cb > m_cch + 1) 271 || ( m_psz == NULL 272 && cb > 0)) 271 273 { 272 274 int rc = RTStrRealloc(&m_psz, cb); -
trunk/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
r69111 r75008 82 82 CHECK(empty.length() == 0); 83 83 CHECK(empty.capacity() == 0); 84 85 empty.reserve(1); 86 CHECK(empty.length() == 0); 87 CHECK(empty.capacity() == 1); 88 char *pszEmpty = empty.mutableRaw(); 89 CHECK(pszEmpty != NULL); 84 90 85 91 RTCString sixbytes("12345");
Note:
See TracChangeset
for help on using the changeset viewer.