From: Donald Sharp Date: Wed, 21 Sep 2016 03:20:02 +0000 (-0400) Subject: lib: Fixup json code to use struct cmd_token X-Git-Tag: frr-3.0-branchpoint~129^2~217 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8a2d6083d6ca49f23668bfb4db83051ee03492d3;p=matthieu%2Ffrr.git lib: Fixup json code to use struct cmd_token --- diff --git a/lib/json.c b/lib/json.c index 58f0e995f2..d06bacece4 100644 --- a/lib/json.c +++ b/lib/json.c @@ -21,6 +21,7 @@ #include +#include "command.h" #include "lib/json.h" /* @@ -29,12 +30,12 @@ * what. */ int -use_json (const int argc, const char *argv[]) +use_json (const int argc, const struct cmd_token *argv[]) { if (argc == 0) return 0; - if (argv[argc-1] && strcmp(argv[argc-1], "json") == 0) + if (argv[argc-1]->arg && strcmp(argv[argc-1]->arg, "json") == 0) return 1; return 0; diff --git a/lib/json.h b/lib/json.h index 5dbad601a3..25fceb1053 100644 --- a/lib/json.h +++ b/lib/json.h @@ -28,7 +28,7 @@ #include #endif -extern int use_json(const int argc, const char *argv[]); +extern int use_json(const int argc, const struct cmd_token *argv[]); extern void json_object_string_add(struct json_object* obj, const char *key, const char *s); extern void json_object_int_add(struct json_object* obj, const char *key,