More fixes

This commit is contained in:
pancake 2017-08-18 03:35:46 +02:00
parent faa826022e
commit a07efba719
5 changed files with 7 additions and 8 deletions

View File

@ -452,7 +452,6 @@ static int cmd_open(void *data, const char *input) {
ut64 addr, baddr = r_config_get_i (core->config, "bin.baddr");
int nowarn = r_config_get_i (core->config, "file.nowarn");
RCoreFile *file;
int num = -1;
int isn = 0;
char *ptr;
RListIter *iter;

View File

@ -1951,7 +1951,6 @@ static void do_string_search(RCore *core, struct search_parameters *param) {
bufsz = core->blocksize;
r_cons_break_push (NULL, NULL);
r_list_foreach (param->boundaries, iter, map) {
int fd;
param->from = map->from;
param->to = map->to;
searchhits = 0;

View File

@ -322,7 +322,7 @@ R_API void r_io_cache_enable(RIO *io, int read, int write);
R_API void r_io_cache_init(RIO *io);
R_API int r_io_cache_list(RIO *io, int rad);
R_API void r_io_cache_reset(RIO *io, int set);
R_API int r_io_cache_write(RIO *io, ut64 addr, const ut8 *buf, int len);
R_API bool r_io_cache_write(RIO *io, ut64 addr, const ut8 *buf, int len);
R_API int r_io_cache_read(RIO *io, ut64 addr, ut8 *buf, int len);
/* io/map.c */

View File

@ -118,28 +118,29 @@ R_API int r_io_cache_list(RIO *io, int rad) {
return false;
}
R_API int r_io_cache_write(RIO *io, ut64 addr, const ut8 *buf, int len) {
R_API bool r_io_cache_write(RIO *io, ut64 addr, const ut8 *buf, int len) {
RIOCache *ch;
ch = R_NEW0 (RIOCache);
if (!ch) {
return 0;
return false;
}
ch->from = addr;
ch->to = addr + len;
ch->size = len;
ch->odata = (ut8*)calloc (1, len + 1);
if (!ch->odata) {
return 0;
return false;
}
ch->data = (ut8*)calloc (1, len + 1);
if (!ch->data) {
free (ch->odata);
return 0;
return false;
}
ch->written = io->cached? false: true;
r_io_read_at (io, addr, ch->odata, len);
memcpy (ch->data, buf, len);
r_list_append (io->cache, ch);
return true;
}
R_API int r_io_cache_read(RIO *io, ut64 addr, ut8 *buf, int len) {

View File

@ -25,7 +25,7 @@ static RIODesc *r_io_ar_open(RIO *io, const char *file, int rw, int mode) {
RBuffer *b = ar_open_file (arname, filename);
if (b) {
res = r_io_desc_new (&r_io_plugin_ar, b->fd, filename, rw, mode, b);
res = r_io_desc_new (io, &r_io_plugin_ar, filename, rw, mode, b);
}
free (url);
return res;