Bug 11709

Summary: DeprecatedString::format is broken on windows
Product: WebKit Reporter: Darin Fisher (:fishd, Google) <fishd>
Component: PlatformAssignee: Darin Fisher (:fishd, Google) <fishd>
Status: RESOLVED FIXED    
Severity: Major    
Priority: P2    
Version: 420+   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
patch darin: review+

Darin Fisher (:fishd, Google)
Reported 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.
Attachments
patch (3.07 KB, patch)
2006-11-28 19:46 PST, Darin Fisher (:fishd, Google)
darin: review+
Darin Fisher (:fishd, Google)
Comment 1 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.
Darin Fisher (:fishd, Google)
Comment 2 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...
Darin Fisher (:fishd, Google)
Comment 3 2006-11-28 19:46:59 PST
Created attachment 11661 [details] patch Use _vscprintf in both places.
Darin Fisher (:fishd, Google)
Comment 4 2006-12-01 15:06:46 PST
Darin Adler
Comment 5 2006-12-01 15:06:55 PST
Comment on attachment 11661 [details] patch Looks great, r=me.
Alexey Proskuryakov
Comment 6 2006-12-02 05:53:09 PST
Committed revision 17985.
Note You need to log in before you can comment on or make changes to this bug.