mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 03:11:28 +00:00
Few code cleanups. (#12526)
This commit is contained in:
parent
23388801f2
commit
2f8891caaf
@ -1779,8 +1779,10 @@ static int esil_poke_n(RAnalEsil *esil, int bits) {
|
||||
if (src2 && r_anal_esil_get_parm (esil, src2, &num2)) {
|
||||
r_write_ble (b, num, esil->anal->big_endian, 64);
|
||||
ret = r_anal_esil_mem_write (esil, addr, b, bytes);
|
||||
r_write_ble (b, num2, esil->anal->big_endian, 64);
|
||||
ret = r_anal_esil_mem_write (esil, addr + 8, b, bytes);
|
||||
if (ret == 0) {
|
||||
r_write_ble (b, num2, esil->anal->big_endian, 64);
|
||||
ret = r_anal_esil_mem_write (esil, addr + 8, b, bytes);
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
ret = -1;
|
||||
|
@ -97,7 +97,7 @@ static int vtable_is_addr_vtable_start(RVTableContext *context, ut64 curAddress)
|
||||
if (!curAddress || curAddress == UT64_MAX) {
|
||||
return false;
|
||||
}
|
||||
if (!vtable_is_value_in_text_section (context, curAddress, NULL)) {
|
||||
if (curAddress && !vtable_is_value_in_text_section (context, curAddress, NULL)) {
|
||||
return false;
|
||||
}
|
||||
// total xref's to curAddress
|
||||
|
@ -39,7 +39,6 @@ static RIODesc *__open(RIO *io, const char *file, int rw, int mode) {
|
||||
if (i) {
|
||||
l = i - file - 8;
|
||||
fileBochs = r_str_ndup (file + 8, l);
|
||||
l = strlen (i + 1);
|
||||
fileCfg = strdup (i + 1);
|
||||
} else {
|
||||
free (fileCfg);
|
||||
|
@ -143,10 +143,15 @@ R_API int r_sys_truncate(const char *file, int sz) {
|
||||
return false;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
_chsize (fd, sz);
|
||||
int r = _chsize (fd, sz);
|
||||
#else
|
||||
ftruncate (fd, sz);
|
||||
int r = ftruncate (fd, sz);
|
||||
#endif
|
||||
if (r != 0) {
|
||||
eprintf ("Could not resize '%s' file\n", file);
|
||||
close (fd);
|
||||
return false;
|
||||
}
|
||||
close (fd);
|
||||
return true;
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user