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) void CTextConsoleWin32::SetStatusLine(char *pszStatus)
{ {
strncpy(statusline, pszStatus, sizeof(statusline) - 1); strncpy(statusline, pszStatus, sizeof(statusline) - 1);
statusline[sizeof statusline - 2] = '\0'; statusline[sizeof(statusline) - 2] = '\0';
UpdateStatus(); UpdateStatus();
} }

View File

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

View File

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