Changeset 989 for cpp/frams/util/sstring.cpp
- Timestamp:
- 07/09/20 00:21:37 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/sstring.cpp
r973 r989 222 222 { 223 223 if (newlength < 0) newlength = strlen(buf->txt); 224 else buf->txt[newlength] = 0; 224 else 225 { 226 if ((newlength >= (buf->size + 1)) || (buf->size == 0)) 227 { 228 assert((newlength < (buf->size + 1)) && (buf->size > 0)); 229 if (buf->size == 0) return; 230 newlength = buf->size; 231 } 232 buf->txt[newlength] = 0; 233 } 225 234 buf->used = newlength; 226 235 } … … 228 237 void SString::endAppend(int newappend) 229 238 { 230 if (newappend < 0) newappend = strlen(buf->txt + appending); 231 else buf->txt[appending + newappend] = 0; 232 buf->used = appending + newappend; 239 if (newappend < 0) endWrite(appending + strlen(buf->txt + appending)); 240 else endWrite(newappend + appending); 233 241 } 234 242
Note: See TracChangeset
for help on using the changeset viewer.