Skip to content

Commit 861bb64

Browse files
Fix bug in at_name_set by removing an unecessary sscanf call
1 parent cf98c61 commit 861bb64

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/apps/ble_at_manager.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -638,15 +638,8 @@ at_error_code_t at_name_set(const uint8_t *param)
638638
{
639639
uint32_t err_code;
640640
at_error_code_t at_err_code;
641-
uint8_t name[31];
642-
memset(name, 0, sizeof(name));
643-
644-
// Check parameters
645-
if (sscanf(param, "%[^\n]", &name) != 1)
646-
{
647-
return AT_ERROR_INVALID_PARAM;
648-
}
649-
641+
uint8_t *name = param;
642+
650643
if (strlen(name) > 27)
651644
{
652645
return AT_ERROR_INVALID_LENGTH;
@@ -664,7 +657,7 @@ at_error_code_t at_name_read(const uint8_t *param)
664657
{
665658
uint32_t err_code;
666659
at_error_code_t at_err_code;
667-
uint8_t name[31];
660+
uint8_t name[31] = "";
668661

669662
// Read value
670663
err_code = ble_manager_name_read(name);

0 commit comments

Comments
 (0)