health check: change --relayd-path arg to --relayd-path=arg
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Jan 2014 19:48:28 +0000 (14:48 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 28 Jan 2014 20:39:45 +0000 (15:39 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/regression/tools/health/health_check.c

index fbf45c81329bba7161e7cc8bcd3dc83c135ee3dd..dc975de99df6af9badc4478175b1cca1a927046a 100644 (file)
@@ -137,14 +137,12 @@ int main(int argc, char *argv[])
        int status = 0, i;
 
        for (i = 1; i < argc; i++) {
-               if (!strcmp(argv[i], "--relayd-path")) {
-                       if (i >= argc - 1) {
-                               fprintf(stderr, "Missing relayd path\n");
-                               exit(EXIT_FAILURE);
-                       }
-                       relayd_path = argv[++i];
+               size_t relayd_path_arg_len = strlen("--relayd-path=");
+               if (!strncmp(argv[i], "--relayd-path=",
+                               relayd_path_arg_len)) {
+                       relayd_path = &argv[i][relayd_path_arg_len];
                } else {
-                       fprintf(stderr, "Unknown option \"%s\". Try --relayd-path PATH.\n", argv[i]);
+                       fprintf(stderr, "Unknown option \"%s\". Try --relayd-path=PATH.\n", argv[i]);
                        exit(EXIT_FAILURE);
                }
        }
This page took 0.02609 seconds and 4 git commands to generate.