--- a/gfxinit.c Thu Feb 08 10:00:22 2007 +0000
+++ b/gfxinit.c Thu Feb 08 10:04:57 2007 +0000
@@ -145,7 +145,7 @@
while ((len = fread(buffer, 1, sizeof(buffer), f)) != 0)
md5_append(&filemd5state, buffer, len);
- if (ferror(f) && warn) fprintf(stderr, "Error Reading from %s \n", buf);
+ if (ferror(f) && warn) ShowInfoF("Error Reading from %s \n", buf);
fclose(f);
md5_finish(&filemd5state, digest);
--- a/openttd.c Thu Feb 08 10:00:22 2007 +0000
+++ b/openttd.c Thu Feb 08 10:04:57 2007 +0000
@@ -163,7 +163,13 @@
p = GetDriverList(p, lastof(buf));
+ /* ShowInfo put output to stderr, but version information should go
+ * to stdout; this is the only exception */
+#if !defined(WIN32) && !defined(WIN64)
+ printf("%s\n", buf);
+#else
ShowInfo(buf);
+#endif
}
--- a/win32.c Thu Feb 08 10:00:22 2007 +0000
+++ b/win32.c Thu Feb 08 10:04:57 2007 +0000
@@ -369,7 +369,7 @@
case WM_INITDIALOG: {
#if defined(UNICODE)
/* We need to put the crash-log in a seperate buffer because the default
- * buffer in MB_TO_WIDE is not large enough (256 chars) */
+ * buffer in MB_TO_WIDE is not large enough (512 chars) */
wchar_t crash_msgW[8096];
#endif
SetDlgItemText(wnd, 10, _crash_desc);
@@ -839,12 +839,16 @@
fprintf(stderr, "%s\n", str);
} else {
bool old;
-
+#if defined(UNICODE)
+ /* We need to put the text in a seperate buffer because the default
+ * buffer in MB_TO_WIDE might not be large enough (512 chars) */
+ wchar_t help_msgW[4096];
+#endif
ReleaseCapture();
_left_button_clicked =_left_button_down = false;
old = MyShowCursor(true);
- if (MessageBox(GetActiveWindow(), MB_TO_WIDE(str), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
+ if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
CreateConsole();
}
MyShowCursor(old);