From 4b612579ea2e1dfc9bb1e5a588cb8713e982e1c9 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Mon, 8 Apr 2024 14:55:34 -0700 Subject: [PATCH] chore(agent): simplify how we look for major version --- agent/fw_support.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index ea4bda243..175b67ff9 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -70,15 +70,9 @@ void nr_fw_support_add_package_supportability_metric( */ for (int i = 0; package_version[i] && i < 4; i++) { if ('.' == package_version[i]) { - strncpy(major_version, package_version, i); - major_version[i] = '\0'; break; } - } - - if ('\0' == major_version[0] && '\0' != package_version[0]) { - strncpy(major_version, package_version, 1); - major_version[1] = '\0'; + major_version[i] = package_version[i]; } if (NR_FW_UNSET == NRINI(force_framework)) {