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

pull/2255/head
elsid 6 years ago
parent cc9a6bfcdd
commit c91deaf7af
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -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);

Loading…
Cancel
Save