http://bugs.winehq.org/show_bug.cgi?id=35369
Bug ID: 35369 Summary: differences between ./dlls/shlwapi/wsprintf.c and ./dlls/user32/wsprintf.c Product: Wine Version: 1.7.10 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: shlwapi Assignee: wine-bugs@winehq.org Reporter: wine13.10.hackie@spamgourmet.com Classification: Unclassified
I was looking for an implementation of wsprintf, then I saw the comments in these files:
dlls/shlwapi/wsprintf.c: * This code is duplicated in user32. If you change something here make sure * to change it in user32 too. dlls/user32/wsprintf.c: * This code is duplicated in shlwapi. If you change something here make sure * to change it in shlwapi too.
This didn't always seem to happen in the past, as you can see in the diff:
--- ./dlls/shlwapi/wsprintf.c 2014-01-03 20:00:47.000000000 +0100 +++ ./dlls/user32/wsprintf.c 2014-01-03 20:00:47.000000000 +0100 (only the most remarkable changes:) (see the data types UINT vs INT) -INT WINAPI wvnsprintfA( LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args ) +static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, __ms_va_list args )
- CHAR number[20]; + CHAR number[21]; /* 64bit number can be 18446744073709551616 which is 20 chars. and a \0 */
Last one might possibly be the reason for some instabilities, depends where the function is used. It's possibly a good idea to try to use the share the same file on both places - and to look for more similar problems...