mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
fix _snprintf calls
This commit is contained in:
parent
995d1f294b
commit
dfae3361a0
@ -1115,7 +1115,7 @@ static DWORD cfg_get_string(LPCSTR key, LPCSTR default_value, LPSTR out_string,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char section[MAX_PATH] = { 0 };
|
char section[MAX_PATH] = { 0 };
|
||||||
_snprintf(section, sizeof(section), "%s?%d", g_config.process_file_name, 2);
|
_snprintf(section, sizeof(section) - 1, "%s?%d", g_config.process_file_name, 2);
|
||||||
|
|
||||||
s = GetPrivateProfileStringA(section, key, "", out_string, out_size, g_config.ini_path);
|
s = GetPrivateProfileStringA(section, key, "", out_string, out_size, g_config.ini_path);
|
||||||
|
|
||||||
@ -1135,7 +1135,7 @@ static DWORD cfg_get_string(LPCSTR key, LPCSTR default_value, LPSTR out_string,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char section[MAX_PATH] = { 0 };
|
char section[MAX_PATH] = { 0 };
|
||||||
_snprintf(section, sizeof(section), "%s/%d", g_config.process_file_name, 2);
|
_snprintf(section, sizeof(section) - 1, "%s/%d", g_config.process_file_name, 2);
|
||||||
|
|
||||||
s = GetPrivateProfileStringA(section, key, "", out_string, out_size, g_config.ini_path);
|
s = GetPrivateProfileStringA(section, key, "", out_string, out_size, g_config.ini_path);
|
||||||
|
|
||||||
@ -1162,8 +1162,8 @@ static BOOL cfg_get_bool(LPCSTR key, BOOL default_value)
|
|||||||
|
|
||||||
static int cfg_get_int(LPCSTR key, int default_value)
|
static int cfg_get_int(LPCSTR key, int default_value)
|
||||||
{
|
{
|
||||||
char def_value[20];
|
char def_value[24];
|
||||||
_snprintf(def_value, sizeof(def_value), "%d", default_value);
|
_snprintf(def_value, sizeof(def_value) - 1, "%d", default_value);
|
||||||
|
|
||||||
char value[20];
|
char value[20];
|
||||||
cfg_get_string(key, def_value, value, sizeof(value));
|
cfg_get_string(key, def_value, value, sizeof(value));
|
||||||
|
@ -58,7 +58,7 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
|
|
||||||
_snprintf(
|
_snprintf(
|
||||||
mes,
|
mes,
|
||||||
sizeof(mes),
|
sizeof(mes) - 1,
|
||||||
"Please disable the '%s' compatibility mode for all game executables and "
|
"Please disable the '%s' compatibility mode for all game executables and "
|
||||||
"then try to start the game again.",
|
"then try to start the game again.",
|
||||||
s);
|
s);
|
||||||
|
@ -29,7 +29,7 @@ DWORD WINAPI gdi_render_main(void)
|
|||||||
|
|
||||||
_snprintf(
|
_snprintf(
|
||||||
warning_text,
|
warning_text,
|
||||||
sizeof(warning_text),
|
sizeof(warning_text) - 1,
|
||||||
"-WARNING- Using slow software rendering, please update your graphics card driver (%s)",
|
"-WARNING- Using slow software rendering, please update your graphics card driver (%s)",
|
||||||
strlen(g_oglu_version) > 10 ? "" : g_oglu_version);
|
strlen(g_oglu_version) > 10 ? "" : g_oglu_version);
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ BOOL ss_take_screenshot(IDirectDrawSurfaceImpl* src)
|
|||||||
CreateDirectoryA(g_config.screenshot_dir, NULL);
|
CreateDirectoryA(g_config.screenshot_dir, NULL);
|
||||||
|
|
||||||
strftime(str_time, sizeof(str_time), "%Y-%m-%d-%H_%M_%S", localtime(&t));
|
strftime(str_time, sizeof(str_time), "%Y-%m-%d-%H_%M_%S", localtime(&t));
|
||||||
_snprintf(filename, sizeof(filename), "%s%s-%s.png", g_config.screenshot_dir, title, str_time);
|
_snprintf(filename, sizeof(filename) - 1, "%s%s-%s.png", g_config.screenshot_dir, title, str_time);
|
||||||
|
|
||||||
if (src->bpp == 8 && src->palette)
|
if (src->bpp == 8 && src->palette)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user