From b13305526af21503edd51a18e94e77b68ee405db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 1 Jan 2019 23:27:54 +0100 Subject: [PATCH] yml: apparently, libyaml's line number in the error context is 0 based Which makes zero sense when reporting the error to the user. --- yml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yml.c b/yml.c index 1d27552..742228e 100644 --- a/yml.c +++ b/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 : "");