Skip to content

Commit 97453a1

Browse files
authored
bugfix: fix string length
1、此处字符串长度最大为 sizeof(str_value)-1,实际比这个更小,错误的长度导致 gx_prompt_text_set_ext(prompt,&string)函数报错
1 parent 6381fa5 commit 97453a1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

samples/demo_guix_thermostat/demo_guix_thermostat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ GX_STRING string;
122122

123123
gx_utility_ltoa(i_temperature, str_value, 10);
124124
string.gx_string_ptr = str_value;
125-
string.gx_string_length = sizeof(str_value) - 1;
125+
string.gx_string_length = GX_STRLEN(str_value);
126126
gx_prompt_text_set_ext(prompt, &string);
127127
}
128128

0 commit comments

Comments
 (0)