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

This commit is contained in:
Tim Rühsen
2021-05-22 16:48:00 +02:00
parent d4431a0b97
commit 170896a76a

View File

@@ -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) {