Put length in its own variable in KURL copyASCII
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2011 22:02:15 +0000 (22:02 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2011 22:02:15 +0000 (22:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73928

Reviewed by Darin Adler.

* platform/KURL.cpp:
(WebCore::copyASCII):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/KURL.cpp

index 11c54ab660707c0916a5170c5335272694289842..92426050ea14c53c9d84a91349d60216a00e645e 100644 (file)
@@ -1,3 +1,13 @@
+2011-12-06  Benjamin Poulain  <benjamin@webkit.org>
+
+        Put length in its own variable in KURL copyASCII
+        https://bugs.webkit.org/show_bug.cgi?id=73928
+
+        Reviewed by Darin Adler.
+
+        * platform/KURL.cpp:
+        (WebCore::copyASCII):
+
 2011-12-06  Dana Jansens  <danakj@chromium.org>
 
         [chromium] Set opaque flag for ImageLayerChromium
 2011-12-06  Dana Jansens  <danakj@chromium.org>
 
         [chromium] Set opaque flag for ImageLayerChromium
index 085ada63077bafbdcef1938f816c9fc5c586a8ee..ab57d85d4bd175637851e803bec59a633636c72e 100644 (file)
@@ -264,7 +264,8 @@ static void copyASCII(const String& string, char* dest)
         memcpy(dest, string.characters8(), string.length());
     else {
         const UChar* src = string.characters16();
         memcpy(dest, string.characters8(), string.length());
     else {
         const UChar* src = string.characters16();
-        for (size_t i = 0; i < string.length(); i++)
+        size_t length = string.length();
+        for (size_t i = 0; i < length; i++)
             dest[i] = static_cast<char>(src[i]);
     }
 }
             dest[i] = static_cast<char>(src[i]);
     }
 }