1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:23:54 +00:00

Use std::vector::data method to avoid reference binding to null pointer

This commit is contained in:
elsid 2019-03-16 00:08:24 +03:00
parent cc9a6bfcdd
commit c91deaf7af
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -104,7 +104,7 @@ namespace ESM
} }
mScriptData.resize(subSize); mScriptData.resize(subSize);
esm.getExact(&mScriptData[0], mScriptData.size()); esm.getExact(mScriptData.data(), mScriptData.size());
break; break;
} }
case ESM::FourCC<'S','C','T','X'>::value: case ESM::FourCC<'S','C','T','X'>::value:
@ -156,7 +156,7 @@ namespace ESM
} }
esm.startSubRecord("SCDT"); esm.startSubRecord("SCDT");
esm.write(reinterpret_cast<const char * >(&mScriptData[0]), mData.mScriptDataSize); esm.write(reinterpret_cast<const char *>(mScriptData.data()), mData.mScriptDataSize);
esm.endRecord("SCDT"); esm.endRecord("SCDT");
esm.writeHNOString("SCTX", mScriptText); esm.writeHNOString("SCTX", mScriptText);