From 4a955ecede4f8aa0ad8eeb071a0d1fca743678d6 Mon Sep 17 00:00:00 2001 From: Duck Deux Date: Thu, 15 Aug 2024 10:23:48 -0700 Subject: [PATCH] add strlen --- libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h b/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h index 9d2b7d9bf63..67c34bf6dcf 100644 --- a/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h +++ b/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h @@ -526,7 +526,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase { bool found_arch_name = false; std::string string_name = std::string(name); // The string name has the format of "Internal Switch/delay". So, I have to use compare to specify the portion I want to be compared. - bool is_internal_sw = string_name.compare(0, 15, VPR_INTERNAL_SWITCH_NAME) == 0; + bool is_internal_sw = string_name.compare(0, strlen(VPR_INTERNAL_SWITCH_NAME), VPR_INTERNAL_SWITCH_NAME) == 0; for (const auto& arch_sw_inf: arch_switch_inf_) { if (string_name == arch_sw_inf.name || is_internal_sw) { found_arch_name = true;