summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index e898214cd8..92b47666e2 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -366,20 +366,20 @@ CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(CJS_Runtime* pRuntime,
while (*p) {
const char* pTemp = strchr(p, ch);
- if (pTemp == NULL) {
+ if (!pTemp) {
StrArray.SetElement(nIndex, CJS_Value(pRuntime, StrTrim(p).c_str()));
break;
- } else {
- char* pSub = new char[pTemp - p + 1];
- strncpy(pSub, p, pTemp - p);
- *(pSub + (pTemp - p)) = '\0';
+ }
- StrArray.SetElement(nIndex, CJS_Value(pRuntime, StrTrim(pSub).c_str()));
- delete[] pSub;
+ char* pSub = new char[pTemp - p + 1];
+ strncpy(pSub, p, pTemp - p);
+ *(pSub + (pTemp - p)) = '\0';
- nIndex++;
- p = ++pTemp;
- }
+ StrArray.SetElement(nIndex, CJS_Value(pRuntime, StrTrim(pSub).c_str()));
+ delete[] pSub;
+
+ nIndex++;
+ p = ++pTemp;
}
return StrArray;
}
@@ -1804,7 +1804,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IJS_Context* cc,
}
CFX_WideString swValue;
- if (pEventHandler->m_pValue != NULL)
+ if (pEventHandler->m_pValue)
swValue = pEventHandler->Value();
if (pEventHandler->WillCommit()) {