From: Dale Weiler Date: Wed, 14 Nov 2012 19:38:05 +0000 (+0000) Subject: Fix teh bugs, thanks div0 X-Git-Tag: 0.1~21 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f0678cfa5a4ec33feee9135fa154eaa17d14bac0;p=xonotic%2Fgmqcc.git Fix teh bugs, thanks div0 --- diff --git a/con.c b/con.c index 3e6c20d..1da837f 100644 --- a/con.c +++ b/con.c @@ -202,7 +202,7 @@ static void con_enablecolor() { #ifndef _WIN32 { - char buf[4]; + char buf[4] = {0, 0, 0, 0}; /* * This is such a hack. But I'm not linking in any libraries to @@ -217,14 +217,15 @@ static void con_enablecolor() { */ console.color_err = 0; console.color_out = 0; + + return; } /* * Handle to tput was a success, lets read in the amount of * color support. It should be at minimal 8. */ - fread(buf, sizeof(buf), 1, tput); - buf[3] = '\0'; + fread(buf, 1, sizeof(buf)-1, tput); if (atoi(buf) < 8) { console.color_err = 0;