forked from external/yambar
yml: apparently, libyaml's line number in the error context is 0 based
Which makes zero sense when reporting the error to the user.
This commit is contained in:
parent
4d46a14a67
commit
b13305526a
1 changed files with 2 additions and 2 deletions
4
yml.c
4
yml.c
|
@ -241,14 +241,14 @@ yml_load(FILE *yml, char **error)
|
|||
if (error != NULL) {
|
||||
int cnt = snprintf(
|
||||
NULL, 0, "%zu:%zu: %s %s",
|
||||
yaml.problem_mark.line,
|
||||
yaml.problem_mark.line + 1,
|
||||
yaml.problem_mark.column,
|
||||
yaml.problem,
|
||||
yaml.context != NULL ? yaml.context : "");
|
||||
|
||||
*error = malloc(cnt + 1);
|
||||
snprintf(*error, cnt + 1, "%zu:%zu: %s %s",
|
||||
yaml.problem_mark.line,
|
||||
yaml.problem_mark.line + 1,
|
||||
yaml.problem_mark.column,
|
||||
yaml.problem,
|
||||
yaml.context != NULL ? yaml.context : "");
|
||||
|
|
Loading…
Add table
Reference in a new issue