Fixed profile string sdk response not being null terminated
This commit is contained in:
parent
faf7f65372
commit
f63aec118c
1 changed files with 2 additions and 2 deletions
|
|
@ -398,7 +398,7 @@ unsigned char * ProfileManager::GetProfileListDescription()
|
|||
for(unsigned int i = 0; i < num_profiles; i++)
|
||||
{
|
||||
data_size += sizeof (unsigned short);
|
||||
data_size += strlen(profile_list[i].c_str());
|
||||
data_size += strlen(profile_list[i].c_str()) + 1;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
|
|
@ -423,7 +423,7 @@ unsigned char * ProfileManager::GetProfileListDescription()
|
|||
\*---------------------------------------------------------*/
|
||||
for(unsigned int i = 0; i < num_profiles; i++)
|
||||
{
|
||||
unsigned short name_len = strlen(profile_list[i].c_str());
|
||||
unsigned short name_len = strlen(profile_list[i].c_str()) + 1;
|
||||
|
||||
memcpy(&data_buf[data_ptr], &name_len, sizeof(name_len));
|
||||
data_ptr += sizeof(name_len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue