2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Added brackets after sizeof

This commit is contained in:
asmodai 2017-03-19 21:56:05 +03:00
parent 2c98e14606
commit 0f4b380bee
3 changed files with 6 additions and 5 deletions

View File

@ -217,7 +217,7 @@ int CTextConsoleWin32::GetWidth()
void CTextConsoleWin32::SetStatusLine(char *pszStatus)
{
strncpy(statusline, pszStatus, sizeof(statusline) - 1);
statusline[sizeof statusline - 2] = '\0';
statusline[sizeof(statusline) - 2] = '\0';
UpdateStatus();
}

View File

@ -56,7 +56,7 @@ void ProcessConsoleInput()
if (inputLine)
{
char szBuf[256];
_snprintf(szBuf, sizeof szBuf, "%s\n", inputLine);
_snprintf(szBuf, sizeof(szBuf), "%s\n", inputLine);
engineAPI->AddConsoleText(szBuf);
}
}
@ -72,6 +72,8 @@ int RunEngine()
if (g_bVGui)
{
// TODO: finish VGUI
//vgui::ivgui()->SetSleep(0);
}
#endif
CreateInterfaceFn engineFactory = Sys_GetFactory(g_pEngineModule);
@ -137,7 +139,6 @@ int RunEngine()
Sys_PrepareConsoleInput();
if (g_bAppHasBeenTerminated)
break;

View File

@ -185,7 +185,7 @@ long CSys::LoadLibrary(char *lib)
char cwd[1024];
char absolute_lib[1024];
if (!getcwd(cwd, sizeof cwd))
if (!getcwd(cwd, sizeof(cwd)))
ErrorMessage(1, "Sys_LoadLibrary: Couldn't determine current directory.");
if (cwd[strlen(cwd) - 1] == '/')
@ -285,7 +285,7 @@ void Sys_PrepareConsoleInput()
int main(int argc, char *argv[])
{
_snprintf(g_szEXEName, sizeof g_szEXEName, "%s", argv[0]);
_snprintf(g_szEXEName, sizeof(g_szEXEName), "%s", argv[0]);
char* cmdline = BuildCmdLine(argc, argv);
StartServer(cmdline);