mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix printf style issues in Windows specific code (GH-17452)
A couple of calls pass strings as formats (`-Wformat-security`), and some others mix up types (`-Wformat`).
This commit is contained in:
parent
26bf239e6d
commit
1675d32261
10 changed files with 17 additions and 17 deletions
|
@ -610,7 +610,7 @@ PHP_FUNCTION(sapi_windows_cp_set)
|
|||
cp = php_win32_cp_set_by_id((DWORD)id);
|
||||
}
|
||||
if (!cp) {
|
||||
php_error_docref(NULL, E_WARNING, "Failed to switch to codepage %d", id);
|
||||
php_error_docref(NULL, E_WARNING, "Failed to switch to codepage " ZEND_LONG_FMT, id);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ static zend_always_inline BOOL is_compatible(HMODULE handle, BOOL is_smaller, ch
|
|||
if (GetModuleFileName(handle, buf, sizeof(buf)) != 0) {
|
||||
spprintf(err, 0, format, buf, major, minor, PHP_LINKER_MAJOR, PHP_LINKER_MINOR);
|
||||
} else {
|
||||
spprintf(err, 0, "Can't retrieve the module name (error %u)", GetLastError());
|
||||
spprintf(err, 0, "Can't retrieve the module name (error %lu)", GetLastError());
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err)
|
|||
# endif
|
||||
HMODULE handle = GetModuleHandle(crt_name);
|
||||
if (handle == NULL) {
|
||||
spprintf(err, 0, "Can't get handle of module %s (error %u)", crt_name, GetLastError());
|
||||
spprintf(err, 0, "Can't get handle of module %s (error %lu)", crt_name, GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
return is_compatible(handle, FALSE, "'%s' %u.%u is not compatible with this PHP build linked with %d.%d", err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue