winefile: Fix a string resource so its format placeholders can be reordered.
Francois Gouget
fgouget at free.fr
Thu Oct 20 07:48:10 CDT 2011
---
programs/winefile/winefile.c | 7 ++++++-
programs/winefile/winefile.rc | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index 03da6b6..78a0230 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -2774,9 +2774,14 @@ static void set_space_status(void)
WCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN];
if (GetDiskFreeSpaceExW(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) {
+ DWORD_PTR args[2];
format_bytes(b1, ulFreeBytesToCaller.QuadPart);
format_bytes(b2, ulTotalBytes.QuadPart);
- wsprintfW(buffer, RS(fmt,IDS_FREE_SPACE_FMT), b1, b2);
+ args[0] = (DWORD_PTR)b1;
+ args[1] = (DWORD_PTR)b2;
+ FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ RS(fmt,IDS_FREE_SPACE_FMT), 0, 0, buffer,
+ sizeof(buffer)/sizeof(*buffer), (va_list*)args);
} else
lstrcpyW(buffer, sQMarks);
diff --git a/programs/winefile/winefile.rc b/programs/winefile/winefile.rc
index 78391a5..4ef3b68 100644
--- a/programs/winefile/winefile.rc
+++ b/programs/winefile/winefile.rc
@@ -117,7 +117,7 @@ STRINGTABLE
IDS_COL_ATTR "Attributes"
IDS_COL_SEC "Security"
- IDS_FREE_SPACE_FMT "%s of %s free"
+ IDS_FREE_SPACE_FMT "%1 of %2 free"
}
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
--
1.7.6.3
More information about the wine-patches
mailing list