1
0
mirror of https://github.com/NevermindZZT/letter-shell.git synced 2025-01-21 10:02:54 +08:00

修复 默认用户设置密码会引发异常的问题

优化 keil环境下防止命令被编译优化
This commit is contained in:
Letter 2020-07-30 18:57:37 +08:00
parent b8efab542b
commit a4a8f98f7d
2 changed files with 2 additions and 2 deletions

View File

@ -1136,7 +1136,7 @@ static void shellSetUser(Shell *shell, const ShellCommand *user)
shell->info.user = user;
shell->status.isChecked =
((user->data.user.password && strlen(user->data.user.password) != 0)
&& (shell->parser.paramCount == 1
&& (shell->parser.paramCount < 2
|| strcmp(user->data.user.password, shell->parser.param[1]) != 0))
? 0 : 1;

View File

@ -68,7 +68,7 @@
#ifndef SECTION
#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && __ARMCC_VERSION >= 6000000)
#define SECTION(x) __attribute__((section(x)))
#define SECTION(x) __attribute__((used, section(x)))
#elif defined(__ICCARM__) || defined(__ICCRX__)
#define SECTION(x) @ x
#elif defined(__GNUC__)