mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-21 11:55:42 +02:00
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) {
|
if (error != NULL) {
|
||||||
int cnt = snprintf(
|
int cnt = snprintf(
|
||||||
NULL, 0, "%zu:%zu: %s %s",
|
NULL, 0, "%zu:%zu: %s %s",
|
||||||
yaml.problem_mark.line,
|
yaml.problem_mark.line + 1,
|
||||||
yaml.problem_mark.column,
|
yaml.problem_mark.column,
|
||||||
yaml.problem,
|
yaml.problem,
|
||||||
yaml.context != NULL ? yaml.context : "");
|
yaml.context != NULL ? yaml.context : "");
|
||||||
|
|
||||||
*error = malloc(cnt + 1);
|
*error = malloc(cnt + 1);
|
||||||
snprintf(*error, cnt + 1, "%zu:%zu: %s %s",
|
snprintf(*error, cnt + 1, "%zu:%zu: %s %s",
|
||||||
yaml.problem_mark.line,
|
yaml.problem_mark.line + 1,
|
||||||
yaml.problem_mark.column,
|
yaml.problem_mark.column,
|
||||||
yaml.problem,
|
yaml.problem,
|
||||||
yaml.context != NULL ? yaml.context : "");
|
yaml.context != NULL ? yaml.context : "");
|
||||||
|
|
Loading…
Add table
Reference in a new issue