summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfattachment.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/fpdfsdk/fpdfattachment.cpp b/fpdfsdk/fpdfattachment.cpp
index d8713bb2e1..e07d15b0c8 100644
--- a/fpdfsdk/fpdfattachment.cpp
+++ b/fpdfsdk/fpdfattachment.cpp
@@ -35,13 +35,10 @@ FPDFDoc_GetAttachmentName(FPDF_DOCUMENT document,
if (!pFile)
return 0;
- CFX_WideString name;
- CPDF_FileSpec filespec(pFile);
- filespec.GetFileName(&name);
- CFX_ByteString encodedName = name.UTF16LE_Encode();
- unsigned long len = encodedName.GetLength();
+ CFX_ByteString name = CPDF_FileSpec(pFile).GetFileName().UTF16LE_Encode();
+ unsigned long len = name.GetLength();
if (buffer && buflen >= len)
- memcpy(buffer, encodedName.c_str(), len);
+ memcpy(buffer, name.c_str(), len);
return len;
}