diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
commit | d24b8183b93e781080b2c16c487e60d51c12da31 (patch) | |
tree | fbb89154858984eb8e41556da7e9433040d55cd4 /libs/utils/String8.cpp | |
parent | f1e484acb594a726fb57ad0ae4cfe902c7f35858 (diff) |
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'libs/utils/String8.cpp')
-rw-r--r-- | libs/utils/String8.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp index ab843f6e798b..c50d343a731b 100644 --- a/libs/utils/String8.cpp +++ b/libs/utils/String8.cpp @@ -317,8 +317,10 @@ status_t String8::real_append(const char* other, size_t otherLen) ->editResize(myLen+otherLen+1); if (buf) { char* str = (char*)buf->data(); - memcpy(str+myLen, other, otherLen+1); mString = str; + str += myLen; + memcpy(str, other, otherLen); + str[otherLen] = '\0'; return NO_ERROR; } return NO_MEMORY; |