Bug 11709 - DeprecatedString::format is broken on windows
Summary: DeprecatedString::format is broken on windows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 420+
Hardware: PC Windows XP
: P2 Major
Assignee: Darin Fisher (:fishd, Google)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-28 19:26 PST by Darin Fisher (:fishd, Google)
Modified: 2006-12-02 05:53 PST (History)
0 users

See Also:


Attachments
patch (3.07 KB, patch)
2006-11-28 19:46 PST, Darin Fisher (:fishd, Google)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Fisher (:fishd, Google) 2006-11-28 19:26:53 PST
DeprecatedString::format is broken on windows

DeprecatedString::setNum(99) for example fails to set the contents of the string to "99".  What's going on is that the initial call to vsnprintf fails, and so the string is assigned an empty value.
Comment 1 Darin Fisher (:fishd, Google) 2006-11-28 19:28:56 PST
There's a comment saying that the code from String::format should be duplicated for DeprecatedString::format!  Is that still the plan?

This bug causes things like "window.location.href" to report an URL that is lacking the port number, which causes some pages not to work properly.
Comment 2 Darin Fisher (:fishd, Google) 2006-11-28 19:46:29 PST
By the way, I think the correct solution is to use _vscprintf instead of calling vsnprintf in a loop like String::format does.  Patch coming up...
Comment 3 Darin Fisher (:fishd, Google) 2006-11-28 19:46:59 PST
Created attachment 11661 [details]
patch

Use _vscprintf in both places.
Comment 4 Darin Fisher (:fishd, Google) 2006-12-01 15:06:46 PST
By the way, the documentation for _vscprintf is here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vclrf_vscprintf_vscwprintf.asp
Comment 5 Darin Adler 2006-12-01 15:06:55 PST
Comment on attachment 11661 [details]
patch

Looks great, r=me.
Comment 6 Alexey Proskuryakov 2006-12-02 05:53:09 PST
Committed revision 17985.