Cleanup
This commit is contained in:
parent
8547b74c3e
commit
a65c53f4b2
1 changed files with 7 additions and 5 deletions
|
|
@ -29,12 +29,14 @@
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "SystemK.h"
|
#include "SystemK.h"
|
||||||
|
|
||||||
uint32_t parse_uint32(const char *str, bool *ok) {
|
static uint32_t parse_uint32(const char *str, bool *ok)
|
||||||
|
{
|
||||||
char *end;
|
char *end;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
unsigned long val = strtoul(str, &end, 10);
|
unsigned long val = strtoul(str, &end, 10);
|
||||||
|
|
||||||
if (errno != 0 || end == str || *end != '\0' || val > UINT32_MAX) {
|
if (errno != 0 || end == str || *end != '\0' || val > UINT32_MAX)
|
||||||
|
{
|
||||||
*ok = false;
|
*ok = false;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +50,7 @@ static void print_usage(void)
|
||||||
printf(
|
printf(
|
||||||
"Usage:\n"
|
"Usage:\n"
|
||||||
" KEvent <Event ID> <Event Data>\n"
|
" KEvent <Event ID> <Event Data>\n"
|
||||||
" (Note that IDs may be SystemK version-dependant.)\n");
|
" (Note that IDs may be SystemK version-dependent.)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_KEvent(int argc, char **argv)
|
static int cmd_KEvent(int argc, char **argv)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue