Skip to content
Snippets Groups Projects
Commit c710de1f authored by Suru Dissanaike's avatar Suru Dissanaike
Browse files

fixed according to cppcheck rec.

parent 9ba82116
No related branches found
No related tags found
No related merge requests found
...@@ -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;
......
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment