Even more coverifix

This commit is contained in:
jvoisin 2014-08-18 15:03:02 +02:00
parent 359846b0d1
commit 9b99c0135d
11 changed files with 20 additions and 20 deletions

View File

@ -14,7 +14,7 @@ static int is_string (const ut8 *buf, int size, int *len) {
for (i=0; i<size; i++) {
if (!buf[i] && i>MINLEN) {
*len = i;
return i?1:0;
return 1;
}
if (buf[i]<32 || buf[i]>127) {
// not ascii text

View File

@ -555,7 +555,7 @@ write_instr_name_(struct arcDisState *state,
{
if(!instrName)
return;
strcpy(state->instrBuffer, instrName);
strncpy(state->instrBuffer, instrName, sizeof(state->instrBuffer));
if (cond > 0)
{
int condlim = 0; /* condition code limit*/

View File

@ -1402,7 +1402,7 @@ R_API void r_bin_list_archs(RBin *bin, int mode) {
i = -1;
r_list_foreach (nbinfile->objs, iter, obj){
RBinInfo *info = obj ? obj->info : NULL;
RBinInfo *info = obj->info;
char bits = info ? info->bits : 0;
ut64 boffset = obj->boffset;
ut32 obj_size = obj->obj_size;

View File

@ -44,6 +44,7 @@ R_API int r_cons_arrow_to_hjkl(int ch) {
ch = r_cons_readchar ();
switch (ch) {
case '[':
ch = r_cons_readchar ();
switch (ch) {
case '2': ch = R_CONS_KEY_F11; break;
case 'A': ch = R_CONS_KEY_F1; break;

View File

@ -243,11 +243,10 @@ R_API void r_cons_pal_list (int rad) {
r >>= 4;
g >>= 4;
b >>= 4;
r_cons_printf ("ec %s rgb:%x%x%x\n", //Color_RESET " # vs %sTEST"Color_RESET"\n",
r_cons_printf ("ec %s rgb:%x%x%x\n",
keys[i].name, r, g, b);
} else
r_cons_printf (" %s##"Color_RESET" %s\n",
(color)? *color: "", keys[i].name);
r_cons_printf (" %s##"Color_RESET" %s\n", *color, keys[i].name);
}
}

View File

@ -582,7 +582,7 @@ R_API int r_core_anal_fcn(RCore *core, ut64 at, ut64 from, int reftype, int dept
ref->type = reftype;
r_list_append (fcn->xrefs, ref);
}
// XXX: this looks weird
// XXX: this is wrong. See CID 1134565
r_anal_fcn_insert (core->anal, fcn);
if (has_next) {
int i;

View File

@ -1311,15 +1311,11 @@ static int r_core_bin_file_print (RCore *core, RBinFile *binfile) {
r_cons_printf("%s %d %d 0x%04x\n", name, id, obj_cnt, bin_sz );
r_list_foreach (binfile->objs, iter, obj) {
RBinInfo *info = obj ? obj->info : NULL;
// id, arch, bits, paddr
RBinInfo *info = obj->info;
ut8 bits = info ? info->bits : 0;
const char *arch = info ? info->arch : "unknown";
ut64 paddr = obj ? obj->boffset : 0;
ut64 size = obj ? obj->obj_size : 0;
ut32 id = obj->id;
r_cons_printf("\t%d) %d %s %d 0x%04"PFMT64x" 0x%04"PFMT64x"\n",
i, id, arch, bits, paddr, size );
i, obj->id, arch, bits, obj->boffset, obj->obj_size );
i++;
}
return R_TRUE;

View File

@ -285,7 +285,7 @@ R_API int r_cmd_macro_add(RCmdMacro *mac, const char *oname) {
macro->name = strdup (name);
}
macro->codelen = (pbody)? strlen (pbody)+2 : 4096;
macro->codelen = (pbody[0])? strlen (pbody)+2 : 4096;
macro->code = (char *)malloc (macro->codelen);
*macro->code = '\0';
macro->nargs = 0;

View File

@ -450,8 +450,7 @@ R_API int r_core_visual_xrefs_X (RCore *core) {
r_cons_printf (" [%i] 0x%08"PFMT64x" %s XREF 0x%08"PFMT64x" (%s) \n", count,
refi->at,
refi->type==R_ANAL_REF_TYPE_CODE?"CODE (JMP)":
refi->type==R_ANAL_REF_TYPE_CALL?"CODE (CALL)":"DATA", refi->addr,
fun?fun->name:"unk");
refi->type==R_ANAL_REF_TYPE_CALL?"CODE (CALL)":"DATA", refi->addr, fun->name);
if (++count > 9) break;
}
}

View File

@ -595,7 +595,7 @@ R_API int r_fs_prompt (RFS *fs, const char *root) {
if (r_list_empty (list)) {
strcpy (path, opath);
eprintf ("cd: unknown path: %s\n", path);
} else r_list_free (list);
}
} else if (!memcmp (buf, "cat ", 4)) {
input = buf+3;
while (input[0] == ' ')

View File

@ -56,9 +56,14 @@ R_API int r_syscall_setup(RSyscall *s, const char *arch, const char *os, int bit
s->regs = fastcall_arm;
else if (!strcmp (arch, "x86")) {
switch (bits) {
case 8: s->regs = fastcall_x86_8;
case 32: s->regs = fastcall_x86_32;
case 64: s->regs = fastcall_x86_64;
case 8:
s->regs = fastcall_x86_8;
break;
case 32:
s->regs = fastcall_x86_32;
break;
case 64:
s->regs = fastcall_x86_64;
}
}