Fix prevent and Sting length issue
authorkeonpyo.kong <keonpyo.kong@samsung.com>
Mon, 8 Apr 2013 10:29:47 +0000 (19:29 +0900)
committerkeonpyo.kong <keonpyo.kong@samsung.com>
Mon, 8 Apr 2013 11:52:10 +0000 (20:52 +0900)
Change-Id: I1d06febbdfb2e6a67b4647933b6e08399022a2ca
Signed-off-by: keonpyo.kong <keonpyo.kong@samsung.com>
Apply code review

Change-Id: I10706b51978cb6f5c7614900065f609d6ba3c3ad
Signed-off-by: keonpyo.kong <keonpyo.kong@samsung.com>
src/ui/FUi_UiBuilder.cpp
src/ui/FUi_UiBuilderControl.cpp

index 4e648ec..3d8ae3c 100644 (file)
@@ -289,8 +289,12 @@ _UiBuilder::Parse(void)
 
 
        returnValue = xmlHandler.Construct(this);
-       SysTryReturn(NID_UI, returnValue == true, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Parse Failed - xmlHandler Construct Failed.");
-
+       if (returnValue ==  false)
+       {
+               delete[] pXmlContents;
+               return E_OPERATION_FAILED;
+       }
+       
        r = xmlHandler.ParseXml(pXmlBuffer, readCount);
        if (r != E_SUCCESS)
        {
index 8941761..4016079 100644 (file)
@@ -362,18 +362,17 @@ _UiBuilderControl::ConvertSpecialChar(Tizen::Base::String& string) const
                        {
                                stringPointer[j] = '\n';
                                i += 2;
-                               j++;
+                               j ++;
                        }
                        else if (stringPointer[i + 1] == 't')
                        {
                                stringPointer[j] = '\t';
                                i += 2;
-                               j++;
+                               j ++;
                        }
                        else
-                               {
+                       {
                                stringPointer[j] = '\\';
-
                                j++;
                                i++;
                        }
@@ -417,12 +416,9 @@ _UiBuilderControl::ConvertSpecialChar(Tizen::Base::String& string) const
                        j++;
                }
        }
-       if (j != i)
-       {
-               for (; j <= i; j++)
-                       stringPointer[j] = '\0';
-       }
 
+       stringPointer[j] = '\0';
+       string.SetLength(j);
 
 }