diff options
Diffstat (limited to 'sw/z80/kernel/boot_loader.c')
-rw-r--r-- | sw/z80/kernel/boot_loader.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/sw/z80/kernel/boot_loader.c b/sw/z80/kernel/boot_loader.c index ddca4f9..03a52b5 100644 --- a/sw/z80/kernel/boot_loader.c +++ b/sw/z80/kernel/boot_loader.c @@ -1,5 +1,6 @@ #include "boot.h" #include "progman.h" +#include "string.h" #define DEFAULT_EXEC_STATUS 0x4000 @@ -14,30 +15,10 @@ void boot_init() { int8_t authenticate(const char *pwd) { - const char *c_pwd = PWD_ADDR, *c_req = pwd; - - for (uint8_t i = 0; i < PWD_SIZE; i++) { - - if (*c_pwd != *c_req) - return 0; - - c_pwd++; - c_req++; - } - - return 1; + return !memcmp(PWD_ADDR, pwd, PWD_SIZE); } void set_pwd(const char *pwd) { - char *c_pwd = PWD_ADDR; - const char *c_req = pwd; - - for (uint8_t i = 0; i < PWD_SIZE; i++) { - - *c_pwd = *c_req; - - c_pwd++; - c_req++; - } + memcpy(PWD_ADDR, pwd, PWD_SIZE); }
\ No newline at end of file |