From 9281f8ed5cfe7465b38cf17cd3630e72bd7c9485 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Fri, 16 Aug 2024 23:48:37 -0500 Subject: [PATCH] Fix possible loss of data warnings in ProfileManager.cpp --- ProfileManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProfileManager.cpp b/ProfileManager.cpp index 39db7309..f85bfa7e 100644 --- a/ProfileManager.cpp +++ b/ProfileManager.cpp @@ -496,7 +496,7 @@ unsigned char * ProfileManager::GetProfileListDescription() /*---------------------------------------------------------*\ | Calculate data size | \*---------------------------------------------------------*/ - unsigned short num_profiles = profile_list.size(); + unsigned short num_profiles = (unsigned short)profile_list.size(); data_size += sizeof(data_size); data_size += sizeof(num_profiles); @@ -529,7 +529,7 @@ unsigned char * ProfileManager::GetProfileListDescription() \*---------------------------------------------------------*/ for(unsigned int i = 0; i < num_profiles; i++) { - unsigned short name_len = strlen(profile_list[i].c_str()) + 1; + unsigned short name_len = (unsigned short)strlen(profile_list[i].c_str()) + 1; memcpy(&data_buf[data_ptr], &name_len, sizeof(name_len)); data_ptr += sizeof(name_len);