mirror of
https://github.com/mirror/wget.git
synced 2026-08-19 09:23:27 +08:00
* fuzz/wget_read_hunk_fuzzer.c: Add explicit cast for C++ compilation
This commit is contained in:
@@ -74,14 +74,15 @@ struct my_context {
|
||||
char peekbuf[512];
|
||||
};
|
||||
|
||||
static int my_peek (int fd _GL_UNUSED, char *buf, int bufsize, void *arg)
|
||||
static int my_peek (int fd _GL_UNUSED, char *buf, int bufsize, void *arg, double d)
|
||||
{
|
||||
(void) d;
|
||||
if (g_read < g_size) {
|
||||
struct my_context *ctx = (struct my_context *) arg;
|
||||
int n = rand() % (g_size - g_read);
|
||||
if (n > bufsize)
|
||||
n = bufsize;
|
||||
if (n > sizeof(ctx->peekbuf))
|
||||
if (n > (int) sizeof(ctx->peekbuf))
|
||||
n = sizeof(ctx->peekbuf);
|
||||
memcpy(buf, g_data + g_read, n);
|
||||
memcpy(ctx->peekbuf, g_data + g_read, n);
|
||||
@@ -91,8 +92,9 @@ static int my_peek (int fd _GL_UNUSED, char *buf, int bufsize, void *arg)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int my_read (int fd _GL_UNUSED, char *buf, int bufsize, void *arg)
|
||||
static int my_read (int fd _GL_UNUSED, char *buf, int bufsize, void *arg, double d)
|
||||
{
|
||||
(void) d;
|
||||
struct my_context *ctx = (struct my_context *) arg;
|
||||
|
||||
if (ctx->peeklen) {
|
||||
|
||||
Reference in New Issue
Block a user