diff options
Diffstat (limited to 'mdk-stage1/stdio-frontend.c')
| -rw-r--r-- | mdk-stage1/stdio-frontend.c | 17 | 
1 files changed, 7 insertions, 10 deletions
| diff --git a/mdk-stage1/stdio-frontend.c b/mdk-stage1/stdio-frontend.c index f99575bed..8c09330b5 100644 --- a/mdk-stage1/stdio-frontend.c +++ b/mdk-stage1/stdio-frontend.c @@ -1,5 +1,5 @@  /* - * Guillaume Cottenceau (gc@mandriva.com) + * Guillaume Cottenceau (gc)   *   * Copyright 2000 Mandriva   * @@ -53,7 +53,7 @@ static void get_any_response(void)  	while (read(0, &t, 1) > 0);  	fcntl(0, F_SETFL, 0);  } -	 +  static int get_int_response(void)  {  	char s[50]; @@ -76,7 +76,6 @@ static char * get_string_response(char * initial_string)  	/* I won't use a scanf/%s since I also want the null string to be accepted -- also, I want the initial_string */  	char s[500];  	int i = 0; -	char buf[10];  	int b_index = 0;  	char b; @@ -89,7 +88,7 @@ static char * get_string_response(char * initial_string)  		strcpy(s, initial_string);  		i = strlen(s);  	} -	 +  	/* from ncurses/tinfo/lib_raw.c:(cbreak) */  	tcgetattr(0, &t);  	t.c_lflag &= ~ICANON; @@ -108,7 +107,6 @@ static char * get_string_response(char * initial_string)  		if (read(0, &b, 1) > 0) {  			if (b_index == 1) {  				if (b == 91) { -					buf[b_index] = b;  					b_index++;  					continue;  				} @@ -131,7 +129,7 @@ static char * get_string_response(char * initial_string)  				b_index = 0;  				continue;  			} -				 +  			if (b == 13)  				break;  			if (b == 127) { @@ -146,7 +144,6 @@ static char * get_string_response(char * initial_string)  					i--;  				}  			} else if (b == 27) { -				buf[b_index] = b;  				b_index++;  			} else {  				printf("%c", b); @@ -226,7 +223,7 @@ void update_progression_raw(int current_size)  		}  	} else  		printf("\033[GStatus: [%8d] bytes loaded...", current_size); -	 +  	fflush(stdout);  } @@ -275,7 +272,7 @@ enum return_type ask_from_list_index(char *msg, char ** elems, char ** elems_com  		}  		if (j == 4)  			j = 0; -		 +  		if (elems_comments)  			elems_comments++;  		i++; @@ -328,7 +325,7 @@ enum return_type ask_from_entries(char *msg, char ** questions, char *** answers  	}  	if (*answers == NULL) -		*answers = (char **) malloc(sizeof(char *) * i); +		*answers = (char **) calloc(1, sizeof(char *) * i);  	else  		already_answers = *answers; | 
