mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Fix #6474 - underflow index in visual hud prompt
This commit is contained in:
parent
de2ae8ca0f
commit
5953145229
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2008-2016 - pancake */
|
||||
/* radare - LGPL - Copyright 2008-2017 - pancake */
|
||||
|
||||
#include <r_cons.h>
|
||||
#include <ctype.h>
|
||||
@ -18,7 +18,9 @@ R_API char *r_cons_hud_file(const char *f, const bool usecolor) {
|
||||
// the lines starting with # )
|
||||
R_API char *r_cons_hud_string(const char *s, const bool usecolor) {
|
||||
char *os, *track, *ret, *o = strdup (s);
|
||||
if (!o) return NULL;
|
||||
if (!o) {
|
||||
return NULL;
|
||||
}
|
||||
RList *fl = r_list_new ();
|
||||
int i;
|
||||
if (!fl) {
|
||||
@ -108,6 +110,9 @@ R_API char *r_cons_hud(RList *list, const char *prompt, const bool usecolor) {
|
||||
first_line = 1;
|
||||
r_cons_gotoxy (0, 0);
|
||||
current_entry_n = 0;
|
||||
if (top_entry_n < 0) {
|
||||
top_entry_n = 0;
|
||||
}
|
||||
selected_entry = NULL;
|
||||
if (prompt && *prompt) {
|
||||
r_cons_print (">> ");
|
||||
|
Loading…
Reference in New Issue
Block a user