Changeset 30318 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Jun 21, 2010 7:49:28 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 62876
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r28800 r30318 50 50 memcpy(m_psz + lenThis, that.m_psz, lenThat); 51 51 m_psz[lenThis + lenThat] = '\0'; 52 m_cbLength = cbBoth - 1; 53 } 54 return *this; 55 } 56 57 MiniString &MiniString::append(const char *pszThat) 58 { 59 size_t cchThat = strlen(pszThat); 60 if (cchThat) 61 { 62 size_t cchThis = length(); 63 size_t cbBoth = cchThis + cchThat + 1; 64 65 reserve(cbBoth); 66 // calls realloc(cbBoth) and sets m_cbAllocated; may throw bad_alloc. 67 #ifndef RT_EXCEPTIONS_ENABLED 68 AssertRelease(capacity() >= cbBoth); 69 #endif 70 71 memcpy(m_psz + cchThis, pszThat, cchThat); 72 m_psz[cbBoth - 1] = '\0'; 52 73 m_cbLength = cbBoth - 1; 53 74 }
Note:
See TracChangeset
for help on using the changeset viewer.