diff options
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/PublicMethods.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index 71726a2db0..c11197d93e 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -358,20 +358,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; } @@ -1796,7 +1796,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()) { |