Re: msvcrt: Implement _fcvt_s. (resend)
28 Dec
2010
28 Dec
'10
4:35 p.m.
Eryk Wieliczko <ewdevel(a)gmail.com> writes:
@@ -1127,9 +1127,9 @@ int CDECL _ecvt_s( char *buffer, MSVCRT_size_t length, double number, int ndigit /* special case - inf */ if(number == HUGE_VAL || number == -HUGE_VAL) { - memset(buffer, '0', ndigits); + memset(buffer, '0', max(ndigits, 0)); memcpy(buffer, infret, min(ndigits, sizeof(infret) - 1 ) ); - buffer[ndigits] = '\0'; + buffer[max(ndigits, 0)] = '\0';
You'd have to fix the memcpy too, though the whole thing doesn't make much sense if ndigits is negative. Probably needs to be rethought, with some test cases. -- Alexandre Julliard julliard(a)winehq.org
5553
Age (days ago)
5553
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard