Fix two covs

This commit is contained in:
pancake 2017-09-18 15:46:55 +02:00
parent f0185a6194
commit 899d561574
2 changed files with 3 additions and 3 deletions

View File

@ -1539,7 +1539,7 @@ R_API int r_core_visual_cmd(RCore *core, const char *arg) {
} else {
// if (r_cons_fgets (buf, sizeof (buf)-4, 0, NULL) <0) buf[0]='\0';
R_FREE (I->line->contents);
(void)r_config_set (core->config, "cmd.cprompt", buf);
(void)r_config_set (core->config, "cmd.cprompt", buf? buf: "");
}
}
break;

View File

@ -179,7 +179,7 @@ R_API void r_rbtree_aug_insert(RBNode **root, void *data, RBNode *node, RBCompar
bool done = false;
RBNode *path[R_RBTREE_MAX_HEIGHT];
for (;;) {
if (! q) {
if (!q) {
q = node;
q->red = true;
p->child[d] = q;
@ -190,7 +190,7 @@ R_API void r_rbtree_aug_insert(RBNode **root, void *data, RBNode *node, RBCompar
q->red = true;
}
}
if (q->red && p->red) {
if (q->red && && p && p->red) {
int d3 = t ? t->child[0] != g : -1, d2 = g->child[0] != p;
if (p->child[d2] == q) {
g = zag (g, d2, sum);