Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e437e04a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use String8/16 c_str [mtp]" into main

parents 3d932a73 fcf5248b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -212,7 +212,7 @@ void MtpDataPacketFuzzer::process() {
                    if (mFdp.ConsumeBool()) {
                    if (mFdp.ConsumeBool()) {
                        std::string str = mFdp.ConsumeRandomLengthString(kMaxLength);
                        std::string str = mFdp.ConsumeRandomLengthString(kMaxLength);
                        android::String16 s(str.c_str());
                        android::String16 s(str.c_str());
                        char16_t* data = const_cast<char16_t*>(s.string());
                        char16_t* data = const_cast<char16_t*>(s.c_str());
                        mtpDataPacket.putString(reinterpret_cast<uint16_t*>(data));
                        mtpDataPacket.putString(reinterpret_cast<uint16_t*>(data));
                    } else {
                    } else {
                        mtpDataPacket.putString(static_cast<uint16_t*>(nullptr));
                        mtpDataPacket.putString(static_cast<uint16_t*>(nullptr));
+1 −1
Original line number Original line Diff line number Diff line
@@ -101,7 +101,7 @@ void MtpPropertyFuzzer::process() {
                    std::string str = mFdp.ConsumeRandomLengthString(kMaxLength);
                    std::string str = mFdp.ConsumeRandomLengthString(kMaxLength);
                    android::String16 s(str.c_str());
                    android::String16 s(str.c_str());
                    if (mFdp.ConsumeBool()) {
                    if (mFdp.ConsumeBool()) {
                        data = const_cast<char16_t*>(s.string());
                        data = const_cast<char16_t*>(s.c_str());
                    }
                    }


                    if (mFdp.ConsumeBool()) {
                    if (mFdp.ConsumeBool()) {