Commit 170896a7 authored by Tim Rühsen's avatar Tim Rühsen 🛠
Browse files

* fuzz/wget_read_hunk_fuzzer.c: Add explicit cast for C++ compilation

parent d4431a0b
Pipeline #327385800 failed with stage
in 0 seconds
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment