summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_interform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 0e44268b39..d8f999ec72 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -500,12 +500,10 @@ bool CPDFSDK_InterForm::SubmitFields(const WideString& csDestination,
bool bIncludeOrExclude,
bool bUrlEncoded) {
ByteString textBuf = ExportFieldsToFDFTextBuf(fields, bIncludeOrExclude);
- size_t nBufSize = textBuf.GetLength();
- if (nBufSize == 0)
+ if (textBuf.IsEmpty())
return false;
- std::vector<uint8_t> buffer(nBufSize);
- memcpy(buffer.data(), textBuf.c_str(), nBufSize);
+ std::vector<uint8_t> buffer(textBuf.begin(), textBuf.end());
if (bUrlEncoded && !FDFToURLEncodedData(&buffer))
return false;
@@ -539,8 +537,7 @@ bool CPDFSDK_InterForm::SubmitForm(const WideString& sDestination,
if (fdfBuffer.IsEmpty())
return false;
- std::vector<uint8_t> buffer(fdfBuffer.GetLength());
- memcpy(buffer.data(), fdfBuffer.c_str(), fdfBuffer.GetLength());
+ std::vector<uint8_t> buffer(fdfBuffer.begin(), fdfBuffer.end());
if (bUrlEncoded && !FDFToURLEncodedData(&buffer))
return false;