Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 4f0e9ec

Browse files
authored
Merge pull request #263 from gnawux/sysctl_parse
Fix the sysctl json parsing
2 parents 9de9caf + 2edc406 commit 4f0e9ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ static int container_parse_sysctl(struct hyper_container *c, char *json, jsmntok
465465

466466
i++;
467467
for (j = 0; j < c->sys_num; j++) {
468-
c->sys[j].path = (json_token_str(json, &toks[++i]));
468+
c->sys[j].path = (json_token_str(json, &toks[i++]));
469469
while((p = strchr(c->sys[j].path, '.')) != NULL) {
470470
*p = '/';
471471
}
472-
c->sys[j].value = (json_token_str(json, &toks[++i]));
472+
c->sys[j].value = (json_token_str(json, &toks[i++]));
473473
dbg_pr(stdout, "sysctl %s:%s\n", c->sys[j].path, c->sys[j].value);
474474
}
475475
return i;

0 commit comments

Comments
 (0)