From 5e933c3f173ddb6a0ee721b26a77df6fb079feb9 Mon Sep 17 00:00:00 2001 From: Michael Binz Date: Sun, 19 Jun 2022 23:02:54 +0200 Subject: [PATCH] Detects missing type after array declaration. Fixes #253. (#255) Co-authored-by: Michael Binz --- tools/xml2cpp-codegen/generator_utils.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/xml2cpp-codegen/generator_utils.cpp b/tools/xml2cpp-codegen/generator_utils.cpp index 0cb6e38..c67681f 100644 --- a/tools/xml2cpp-codegen/generator_utils.cpp +++ b/tools/xml2cpp-codegen/generator_utils.cpp @@ -85,6 +85,15 @@ static void _parse_signature(const std::string &signature, std::string &type, un break; } + case '\0': + { + std::cerr << + "Invalid array definition. Type is missing after '" << signature + << "'." + << std::endl; + exit(-1); + } + default: { type += "std::vector<";