From: Dale Weiler Date: Sun, 23 Dec 2012 08:08:05 +0000 (+0000) Subject: Actually fix the segfault this time X-Git-Tag: 0.2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f598fbeaea1a4d5a21d059b0ab21f19d1e813f77;p=xonotic%2Fgmqcc.git Actually fix the segfault this time --- diff --git a/conout.c b/conout.c index eb57d68..a57881b 100644 --- a/conout.c +++ b/conout.c @@ -293,11 +293,11 @@ int con_change(const char *out, const char *err) { * Defaultizer because stdio.h shouldn't be used anywhere except here * and inside file.c To prevent mis-match of wrapper-interfaces. */ -void con_default_out() { - console.handle_out = stdout; +FILE *con_default_out() { + return (console.handle_out = stdout); } -void con_default_err() { - console.handle_err = stderr; +FILE *con_default_err() { + return (console.handle_err = stderr); } int con_verr(const char *fmt, va_list va) { diff --git a/gmqcc.h b/gmqcc.h index cbb8cb3..8302d28 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -663,8 +663,8 @@ enum { LVL_ERROR }; -void con_default_out(); -void con_default_err(); +FILE *con_default_out(); +FILE *con_default_err(); void con_vprintmsg (int level, const char *name, size_t line, const char *msgtype, const char *msg, va_list ap); void con_printmsg (int level, const char *name, size_t line, const char *msgtype, const char *msg, ...); diff --git a/main.c b/main.c index 2e1acb5..838a26d 100644 --- a/main.c +++ b/main.c @@ -566,7 +566,7 @@ int main(int argc, char **argv) { } } else { - con_default_out(); + outfile = con_default_out(); } }