Skip to content

Commit d73126c

Browse files
committed
Insert parameters into fsdev_init
Function fsdev_init is called always as fsdev_init(NULL, 0). Therefore, we can remove the parameters and define their values inside the function instead.
1 parent d4cf11e commit d73126c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/OVAL/probes/findfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ int find_files(SEXP_t * spath, SEXP_t * sfilename, SEXP_t * behaviors,
122122
stmp = probe_ent_getattrval(behaviors, "recurse_file_system");
123123

124124
if (stmp && !SEXP_strncmp(stmp, "local", 6)) {
125-
if ((setting->dev_list = fsdev_init(NULL, 0)) == NULL) {
125+
if ((setting->dev_list = fsdev_init()) == NULL) {
126126
SEXP_free(stmp);
127127
goto error;
128128
}

src/OVAL/probes/fsdev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ static fsdev_t *__fsdev_init(fsdev_t * lfs, const char **fs, size_t fs_cnt)
343343
}
344344
#endif
345345

346-
fsdev_t *fsdev_init(const char **fs, size_t fs_cnt)
346+
fsdev_t *fsdev_init()
347347
{
348+
const char **fs = NULL;
349+
size_t fs_cnt = 0;
348350
fsdev_t *lfs;
349351

350352
lfs = malloc(sizeof(fsdev_t));

src/OVAL/probes/oval_fts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ OVAL_FTS *oval_fts_open_prefixed(const char *prefix, SEXP_t *path, SEXP_t *filen
878878
#if defined(__SVR4) && defined(__sun)
879879
ofts->localdevs = NULL;
880880
#else
881-
ofts->localdevs = fsdev_init(NULL, 0);
881+
ofts->localdevs = fsdev_init();
882882
if (ofts->localdevs == NULL) {
883883
dE("fsdev_init() failed.");
884884
/* One dummy read to get rid of an uninitialized

src/OVAL/probes/public/fsdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ typedef struct {
4848
* Initialize the fsdev_t structure from an array of filesystem
4949
* names.
5050
*/
51-
fsdev_t *fsdev_init(const char **fs, size_t fs_cnt);
51+
fsdev_t *fsdev_init(void);
5252

5353
/**
5454
* Free the fsdev_t structure.

0 commit comments

Comments
 (0)