From adb5731acecb2ca2e1415ca87eb43a1851a0ca75 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 17 Jun 2024 09:32:34 -0700 Subject: [PATCH] A package name must have more than three characters --- vvp/vpi_signal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index 59fee8647..f7af479e2 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2023 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2024 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -108,7 +108,7 @@ char *generic_get_str(int code, vpiHandle ref, const char *name, const char *ind if (code == vpiFullName) { bn = strdup(vpi_get_str(code,ref)); size_t bn_len = strlen(bn); - is_bn_a_pkg = bn[bn_len-1] == ':' && bn[bn_len-2] == ':'; + is_bn_a_pkg = (bn_len > 3) && (bn[bn_len-1] == ':') && (bn[bn_len-2] == ':'); len += bn_len; if (! is_bn_a_pkg) len += 1; // include space for "." separator }