Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ubus-api-validator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IOPSYS
ubus-api-validator
Commits
c710de1f
Commit
c710de1f
authored
5 years ago
by
Suru Dissanaike
Browse files
Options
Downloads
Patches
Plain Diff
fixed according to cppcheck rec.
parent
9ba82116
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.c
+4
-3
4 additions, 3 deletions
main.c
ubus_api_validator.c
+1
-1
1 addition, 1 deletion
ubus_api_validator.c
with
5 additions
and
4 deletions
main.c
+
4
−
3
View file @
c710de1f
...
@@ -81,8 +81,7 @@ static void parse_command_line_args(int argc, char *argv[]) {
...
@@ -81,8 +81,7 @@ static void parse_command_line_args(int argc, char *argv[]) {
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
DIR
*
d
;
struct
dirent
*
dir
;
int
rv
;
int
rv
;
parse_command_line_args
(
argc
,
argv
);
parse_command_line_args
(
argc
,
argv
);
...
@@ -103,12 +102,14 @@ int main(int argc, char *argv[]) {
...
@@ -103,12 +102,14 @@ int main(int argc, char *argv[]) {
validate_path
(
global_args
.
path
);
validate_path
(
global_args
.
path
);
if
(
global_args
.
path
==
NULL
&&
global_args
.
dir_path
!=
NULL
)
{
if
(
global_args
.
path
==
NULL
&&
global_args
.
dir_path
!=
NULL
)
{
DIR
*
d
;
// printf("\n working with directory: %s \n ", global_args.dir_path);
// printf("\n working with directory: %s \n ", global_args.dir_path);
d
=
opendir
(
global_args
.
dir_path
);
d
=
opendir
(
global_args
.
dir_path
);
if
(
d
)
{
if
(
d
)
{
struct
dirent
*
dir
;
while
((
dir
=
readdir
(
d
))
!=
NULL
)
{
while
((
dir
=
readdir
(
d
))
!=
NULL
)
{
char
*
res
;
char
*
res
;
char
*
format
;
char
*
format
;
...
...
This diff is collapsed.
Click to expand it.
ubus_api_validator.c
+
1
−
1
View file @
c710de1f
...
@@ -49,7 +49,6 @@ int validate_path(char *path) {
...
@@ -49,7 +49,6 @@ int validate_path(char *path) {
static
int
validate_jobj
(
struct
json_object
*
jobj
)
{
static
int
validate_jobj
(
struct
json_object
*
jobj
)
{
struct
json_object
*
tmp
;
struct
json_object
*
result
=
NULL
;
struct
json_object
*
result
=
NULL
;
struct
json_object
*
ubus_object
;
struct
json_object
*
ubus_object
;
struct
json_object
*
ubus_calls
;
struct
json_object
*
ubus_calls
;
...
@@ -69,6 +68,7 @@ static int validate_jobj(struct json_object *jobj) {
...
@@ -69,6 +68,7 @@ static int validate_jobj(struct json_object *jobj) {
for
(
i
=
0
;
i
<
json_object_array_length
(
ubus_calls
);
i
++
)
{
for
(
i
=
0
;
i
<
json_object_array_length
(
ubus_calls
);
i
++
)
{
struct
json_object
*
tmp
;
struct
json_object
*
ubus_method
;
struct
json_object
*
ubus_method
;
struct
json_object
*
ubus_args
;
struct
json_object
*
ubus_args
;
const
char
*
method
;
const
char
*
method
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment