Fix divbyzero and garbage variable found by clang-analyzer

This commit is contained in:
pancake 2019-09-03 00:16:43 +02:00
parent 197562b516
commit 4cede2ed45
2 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,7 @@ static ut32 consume_r (RBuffer *b, ut64 max, size_t *n_out, ConsumeFcn consume_f
}
static size_t consume_u32_r (RBuffer *b, ut64 max, ut32 *out) {
size_t n;
size_t n = 0;
ut32 tmp = consume_r (b, max, &n, read_u32_leb128);
if (out) {
*out = tmp;

View File

@ -1675,7 +1675,9 @@ static inline void printHistBlock (RPrint *p, int k, int cols) {
kol[2] = pal->cjmp;
kol[3] = pal->jmp;
kol[4] = pal->call;
if (cols < 1) {
cols = 1;
}
const bool show_colors = (p && (p->flags & R_PRINT_FLAGS_COLOR));
if (show_colors) {
int idx = (int) ((k * 4) / cols);