Fix teh bugs, thanks div0

This commit is contained in:
Dale Weiler 2012-11-14 19:38:05 +00:00
parent db7a1784d4
commit f0678cfa5a

7
con.c
View file

@ -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;