From b66395dc570b5c270dd0da4a1b0b121e5617a26e Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Tue, 20 Aug 2019 11:54:42 -0700 Subject: [PATCH] include actual size in error message (#490) * include actual size in error message Signed-off-by: Dirk Thomas * use %u for existing arguments Signed-off-by: Dirk Thomas --- rcl_yaml_param_parser/src/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rcl_yaml_param_parser/src/parser.c b/rcl_yaml_param_parser/src/parser.c index 3e840d2..3098ba5 100644 --- a/rcl_yaml_param_parser/src/parser.c +++ b/rcl_yaml_param_parser/src/parser.c @@ -936,7 +936,8 @@ static rcutils_ret_t parse_value( if (val_size > MAX_STRING_SIZE) { RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING( - "Scalar value at line %d is bigger than %d bytes", line_num, MAX_STRING_SIZE); + "Scalar value at line %u has %zu bytes which is bigger than the compile " + "time limit of %u bytes", line_num, val_size, MAX_STRING_SIZE); return RCUTILS_RET_ERROR; } else { if (style != YAML_SINGLE_QUOTED_SCALAR_STYLE &&