From 788ffbb6300e3b2e87b1c5ee44a2e9833a648fe3 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Thu, 1 Aug 2019 12:36:29 -0500 Subject: [PATCH] Minor fix for YAML number warning This will properly make sure numbers are identified without giving a false positive for ".". Closes: #298 Approved by: alexlarsson --- src/builder-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/builder-utils.c b/src/builder-utils.c index 21a1323f..fa5ab871 100644 --- a/src/builder-utils.c +++ b/src/builder-utils.c @@ -423,7 +423,8 @@ parse_yaml_node_to_json (yaml_document_t *doc, yaml_node_t *node) json_node_init_int (json, num); break; } - else if (*endptr == '.') + // Make sure that N.N, N., and .N (where N is a digit) are picked up as numbers. + else if (*endptr == '.' && (endptr != scalar || endptr[1] != '\0')) { g_ascii_strtoll (endptr + 1, &endptr, 10); if (*endptr == '\0')