Skip to content

Commit

Permalink
Avoid a cast
Browse files Browse the repository at this point in the history
This cast and rename of the `void *arg` to `struct pfdata *pfd`
isn't necessary, we can change the argument type to the actual type,
because the function is called only once and therefore always with
an argument of the `struct pfdata *` type.
  • Loading branch information
jan-cerny committed Nov 16, 2023
1 parent 3f23bb8 commit 52369b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/OVAL/probes/independent/textfilecontent54_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ struct pfdata {
oscap_pcre_t *compiled_regex;
};

static int process_file(const char *prefix, const char *path, const char *file, void *arg, oval_schema_version_t over)
static int process_file(const char *prefix, const char *path, const char *file, struct pfdata *pfd, oval_schema_version_t over)
{
struct pfdata *pfd = (struct pfdata *) arg;
int ret = 0, path_len, file_len, cur_inst = 0, fd = -1, substr_cnt,
buf_size = 0, buf_used = 0, ofs = 0, buf_inc = 4096;
char **substrs = NULL;
Expand Down

0 comments on commit 52369b0

Please sign in to comment.