diff --git a/include/utils/String8.h b/include/utils/String8.h index 2a75b9886..7734cfb52 100644 --- a/include/utils/String8.h +++ b/include/utils/String8.h @@ -49,7 +49,7 @@ public: String8(const String8& o); explicit String8(const char* o); explicit String8(const char* o, size_t numChars); - + explicit String8(const String16& o); explicit String8(const char16_t* o); explicit String8(const char16_t* o, size_t numChars); @@ -66,9 +66,9 @@ public: inline size_t size() const; inline size_t bytes() const; inline bool isEmpty() const; - + size_t length() const; - + void clear(); void setTo(const String8& other); @@ -95,10 +95,10 @@ public: inline String8& operator=(const String8& other); inline String8& operator=(const char* other); - + inline String8& operator+=(const String8& other); inline String8 operator+(const String8& other) const; - + inline String8& operator+=(const char* other); inline String8 operator+(const char* other) const; @@ -110,20 +110,20 @@ public: inline bool operator!=(const String8& other) const; inline bool operator>=(const String8& other) const; inline bool operator>(const String8& other) const; - + inline bool operator<(const char* other) const; inline bool operator<=(const char* other) const; inline bool operator==(const char* other) const; inline bool operator!=(const char* other) const; inline bool operator>=(const char* other) const; inline bool operator>(const char* other) const; - + inline operator const char*() const; - + char* lockBuffer(size_t size); void unlockBuffer(); status_t unlockBuffer(size_t size); - + // return the index of the first byte of other in this at or after // start, or -1 if not found ssize_t find(const char* other, size_t start = 0) const; diff --git a/libutils/String8.cpp b/libutils/String8.cpp index 771d31266..ad4528291 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp @@ -362,7 +362,7 @@ status_t String8::appendFormatV(const char* fmt, va_list args) status_t String8::real_append(const char* other, size_t otherLen) { const size_t myLen = bytes(); - + SharedBuffer* buf = SharedBuffer::bufferFromData(mString) ->editResize(myLen+otherLen+1); if (buf) {