mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-20 19:02:41 +01:00
(svn r16273) [0.7] -Backport from trunk:
- Fix: Wrong number of parameters or wrong parameter types sent to printf-like functions at several places (r16269) - Fix: [NewGRF] When callback 2E returns an amount of 0, do not transport 1 unit to the station (r16268) - Fix: [NoAI] Various documentation omissions with respect to IDs of various objects and corners for AITile::(Raise|Lower)Tile (r16267,r16266)
This commit is contained in:
@@ -1082,13 +1082,13 @@ void DetermineBasePaths(const char *exe)
|
||||
_searchpaths[SP_WORKING_DIR] = strdup(tmp);
|
||||
|
||||
if (!GetModuleFileName(NULL, path, lengthof(path))) {
|
||||
DEBUG(misc, 0, "GetModuleFileName failed (%d)\n", GetLastError());
|
||||
DEBUG(misc, 0, "GetModuleFileName failed (%lu)\n", GetLastError());
|
||||
_searchpaths[SP_BINARY_DIR] = NULL;
|
||||
} else {
|
||||
TCHAR exec_dir[MAX_PATH];
|
||||
_tcsncpy(path, MB_TO_WIDE_BUFFER(exe, path, lengthof(path)), lengthof(path));
|
||||
if (!GetFullPathName(path, lengthof(exec_dir), exec_dir, NULL)) {
|
||||
DEBUG(misc, 0, "GetFullPathName failed (%d)\n", GetLastError());
|
||||
DEBUG(misc, 0, "GetFullPathName failed (%lu)\n", GetLastError());
|
||||
_searchpaths[SP_BINARY_DIR] = NULL;
|
||||
} else {
|
||||
strecpy(tmp, WIDE_TO_MB_BUFFER(exec_dir, tmp, lengthof(tmp)), lastof(tmp));
|
||||
@@ -1281,7 +1281,7 @@ char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
|
||||
{
|
||||
int len = WideCharToMultiByte(CP_UTF8, 0, name, -1, utf8_buf, (int)buflen, NULL, NULL);
|
||||
if (len == 0) {
|
||||
DEBUG(misc, 0, "[utf8] W2M error converting wide-string. Errno %d", GetLastError());
|
||||
DEBUG(misc, 0, "[utf8] W2M error converting wide-string. Errno %lu", GetLastError());
|
||||
utf8_buf[0] = '\0';
|
||||
}
|
||||
|
||||
@@ -1300,7 +1300,7 @@ wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen)
|
||||
{
|
||||
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, utf16_buf, (int)buflen);
|
||||
if (len == 0) {
|
||||
DEBUG(misc, 0, "[utf8] M2W error converting '%s'. Errno %d", name, GetLastError());
|
||||
DEBUG(misc, 0, "[utf8] M2W error converting '%s'. Errno %lu", name, GetLastError());
|
||||
utf16_buf[0] = '\0';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user