summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDuyoung Jang <duyoung.jang@samsung.com>2013-01-15 21:01:54 +0900
committerDuyoung Jang <duyoung.jang@samsung.com>2013-01-15 21:01:54 +0900
commitd15327866f25f60643bb0113907ac33eb87b7285 (patch)
tree431f08265f14ef4ec73d246ea2e9e70a18b1c143 /src
parent408ab34aee7da5b10fa2463ce0a4dd1d7bc159f5 (diff)
downloadinstaller-d15327866f25f60643bb0113907ac33eb87b7285.tar.gz
installer-d15327866f25f60643bb0113907ac33eb87b7285.tar.bz2
installer-d15327866f25f60643bb0113907ac33eb87b7285.zip
Fix parsing error for multi-language
Change-Id: I4520858189343f2b6e6ced3e95fd6a5fda13d63b Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/XmlHandler/XmlHandler.cpp19
-rwxr-xr-xsrc/XmlHandler/XmlHandler.h4
2 files changed, 11 insertions, 12 deletions
diff --git a/src/XmlHandler/XmlHandler.cpp b/src/XmlHandler/XmlHandler.cpp
index 75964f0..d36ec2e 100755
--- a/src/XmlHandler/XmlHandler.cpp
+++ b/src/XmlHandler/XmlHandler.cpp
@@ -153,14 +153,11 @@ XmlHandler::EndElement(void *ctx, const xmlChar *name)
XmlHandler *pHandler = null;
pHandler = (XmlHandler *)ctx;
bool xmlResult = false;
- String* pCharacters = pHandler->GetCharacters();
+ char* pCharacters = pHandler->GetCharacters();
- if (pCharacters && (pCharacters->IsEmpty() == false))
+ if (pCharacters && (strlen(pCharacters) > 0))
{
- std::unique_ptr<char[]> pCharacter(_StringConverter::CopyToCharArrayN(*pCharacters));
- TryReturnVoid(pCharacter, "pCharacter is null.");
-
- xmlResult = pHandler->OnCharacters(pCharacter.get());
+ xmlResult = pHandler->OnCharacters(pCharacters);
if (xmlResult == false)
{
pHandler->SetError();
@@ -406,16 +403,18 @@ XmlHandler::SetCharacters(const char* pCharacter)
if (__pCharacters == null)
{
- __pCharacters = new (std::nothrow) String(4096);
+ __pCharacters = new (std::nothrow) char[4096];
TryReturn(__pCharacters, false, "[osp-installer] __pCharacters is null");
+
+ memset(__pCharacters, 0, 4096);
}
- __pCharacters->Append(pCharacter);
+ strncat(__pCharacters, pCharacter, strlen(pCharacter));
return true;
}
-String*
+char*
XmlHandler::GetCharacters(void)
{
return __pCharacters;
@@ -424,7 +423,7 @@ XmlHandler::GetCharacters(void)
void
XmlHandler::DeleteCharacters(void)
{
- delete __pCharacters;
+ delete[] __pCharacters;
__pCharacters = null;
}
diff --git a/src/XmlHandler/XmlHandler.h b/src/XmlHandler/XmlHandler.h
index 7c25b83..8d3c6bd 100755
--- a/src/XmlHandler/XmlHandler.h
+++ b/src/XmlHandler/XmlHandler.h
@@ -78,7 +78,7 @@ protected:
void DeleteElement(void);
bool SetCharacters(const char* pCharacter);
- Tizen::Base::String* GetCharacters(void);
+ char* GetCharacters(void);
void DeleteCharacters(void);
void SetAttribute(XmlAttribute *pAttr);
@@ -96,7 +96,7 @@ private:
XmlAttribute* __pAttr;
char* __pElementName;
- Tizen::Base::String* __pCharacters;
+ char* __pCharacters;
Tizen::Base::Collection::Stack __elementStack;
bool __error;