mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-03 04:05:06 +00:00
Fix CID 1135045 and some GCC warnings
This commit is contained in:
parent
e0024940ca
commit
f664e91c1b
@ -26,14 +26,15 @@ static int __write(struct r_io_t *io, RIODesc *fd, const ut8 *buf, int count) {
|
||||
}
|
||||
|
||||
static int __read(struct r_io_t *io, RIODesc *fd, ut8 *buf, int count) {
|
||||
int sz = RIOHTTP_SZ (fd);
|
||||
unsigned int sz;
|
||||
if (fd == NULL || fd->data == NULL)
|
||||
return -1;
|
||||
sz = RIOHTTP_SZ (fd);
|
||||
if (io->off >= sz)
|
||||
return -1;
|
||||
if (io->off+count >= sz)
|
||||
count = sz-io->off;
|
||||
memcpy (buf, RIOHTTP_BUF (fd)+io->off, count);
|
||||
if (io->off + count >= sz)
|
||||
count = sz - io->off;
|
||||
memcpy (buf, RIOHTTP_BUF (fd) + io->off, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user