]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
PRVM: optimise tempstring creation
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 4d272e365f52aa42352b6a525e6c9d79fb698a40..d291799ce7f5b9f3bafd91a60f248a5f62a601b3 100644 (file)
--- a/host.c
+++ b/host.c
@@ -89,6 +89,10 @@ void Host_Error (const char *error, ...)
        static char hosterrorstring2[MAX_INPUTLINE]; // THREAD UNSAFE
        static qbool hosterror = false;
        va_list argptr;
+       int outfd = sys.outfd;
+
+       // set output to stderr
+       sys.outfd = fileno(stderr);
 
        // turn off rcon redirect if it was active when the crash occurred
        // to prevent loops when it is a networking problem
@@ -109,7 +113,7 @@ void Host_Error (const char *error, ...)
                Sys_Error ("Host_Error: recursively entered (original error was: %s    new error is: %s)", hosterrorstring2, hosterrorstring1);
        hosterror = true;
 
-       strlcpy(hosterrorstring2, hosterrorstring1, sizeof(hosterrorstring2));
+       dp_strlcpy(hosterrorstring2, hosterrorstring1, sizeof(hosterrorstring2));
 
        CL_Parse_DumpPacket();
 
@@ -141,6 +145,9 @@ void Host_Error (const char *error, ...)
 
        hosterror = false;
 
+       // restore configured outfd
+       sys.outfd = outfd;
+
        Host_AbortCurrentFrame();
 }
 
@@ -293,7 +300,6 @@ static void Host_InitLocal (void)
 
 char engineversion[128];
 
-qbool sys_nostdout = false;
 
 static qfile_t *locksession_fh = NULL;
 static qbool locksession_run = false;
@@ -424,10 +430,6 @@ static void Host_Init (void)
                gl_printcheckerror.integer = 1;gl_printcheckerror.string = "1";
        }
 
-// COMMANDLINEOPTION: Console: -nostdout disables text output to the terminal the game was launched from
-       if (Sys_CheckParm("-nostdout"))
-               sys_nostdout = 1;
-
        // -dedicated is checked in SV_ServerOptions() but that's too late for Cvar_RegisterVariable() to skip all the client-only cvars
        if (Sys_CheckParm ("-dedicated") || !cl_available)
                cls.state = ca_dedicated;