Fix null deref in RCons.swapGround

This commit is contained in:
pancake 2017-03-30 09:51:45 +02:00
parent 29be000e3c
commit d023e33790

View File

@ -1223,6 +1223,9 @@ R_API char *r_cons_lastline (int *len) {
/* swap color from foreground to background, returned value must be freed */
R_API char *r_cons_swap_ground(const char *col) {
if (!col) {
return NULL;
}
if (!strncmp (col, "\x1b[48;5;", 7)) {
/* rgb background */
return r_str_newf ("\x1b[38;5;%s", col+7);