I am now inclined to think - and in line with what you say - that it would be
safer and more efficient to modify FillNumberFmt() to take two more arguments
and pass the buffer sizes in as well, i.e., in effect, its declaration should
be:
static void
FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal
Miko?aj Zalewski wrote:
> I'm afraid this is worse than it was - if a separator will happen to
> be longer than 7 characters plus NUL you will write part the end of the
> buffer (the buffers in FormatInt and FormatDouble are 8 characters
> long). If you really want to support strings of any leng
Andrew Talbot wrote:
I am about to submit another try, to see what people think. This time I'm
using GetLocaleInfoW() twice for each buffer: once, to determine the size
needed, and again, to actually get the locale info.
I'm afraid this is worse than it was - if a separator will happen to
b
Miko?aj Zalewski wrote:
> Andrew Talbot wrote:
> I've wrote that code and forgot that sizeof(parameter array) is the
> size of a pointer. The current code will actually work as in current
> wine there is no locale that has more than one character (plus the NUL
> terminator) for the decimal or th
Andrew Talbot wrote:
Dan Kegel wrote:
BTW the way you define the new size, as a magic constant, seems
bad. Can you use 4 * sizeof(WCHAR), or whatever, instead of 8?
And even then, the '4' seems almost as bad.
- Dan
Yes, I did feel uneasy about using a magic constant, I must admit. A
Dan Kegel wrote:
> BTW the way you define the new size, as a magic constant, seems
> bad. Can you use 4 * sizeof(WCHAR), or whatever, instead of 8?
> And even then, the '4' seems almost as bad.
> - Dan
Yes, I did feel uneasy about using a magic constant, I must admit. Another
way to handle it wo
Andrew Talbot wrote:
>A formal parameter declared as an array is treated as a pointer; any size
>specifier is ignored. So here, sizeof decimal_buffer, for example, would
>equate to the size of a pointer to WCHAR, not to that of an array of eight
>WCHARs.
Why are you doing this?
Are you asking w
Dan Kegel wrote:
> Andrew Talbot wrote:
>>A formal parameter declared as an array is treated as a pointer; any size
>>specifier is ignored. So here, sizeof decimal_buffer, for example, would
>>equate to the size of a pointer to WCHAR, not to that of an array of eight
>>WCHARs.
>
> Why are you doi
Andrew Talbot wrote:
A formal parameter declared as an array is treated as a pointer; any size
specifier is ignored. So here, sizeof decimal_buffer, for example, would
equate to the size of a pointer to WCHAR, not to that of an array of eight
WCHARs.
Why are you doing this?
- Dan