mirror of https://github.com/FOME-Tech/fome-fw.git
cli_registry: save 99 bytes (#3992)
This commit is contained in:
parent
d0154f2b9d
commit
628c1eae4c
|
@ -24,6 +24,8 @@
|
||||||
/* for isspace() */
|
/* for isspace() */
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#define MAX_CMD_LINE_LENGTH 100
|
||||||
|
|
||||||
// todo: support \t as well
|
// todo: support \t as well
|
||||||
#define SPACE_CHAR ' '
|
#define SPACE_CHAR ' '
|
||||||
|
|
||||||
|
@ -500,7 +502,7 @@ char *validateSecureLine(char *line) {
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char handleBuffer[200];
|
static char handleBuffer[MAX_CMD_LINE_LENGTH + 1];
|
||||||
|
|
||||||
static int handleConsoleLineInternal(const char *commandLine, int lineLength) {
|
static int handleConsoleLineInternal(const char *commandLine, int lineLength) {
|
||||||
int len = minI(lineLength, sizeof(handleBuffer) - 1);
|
int len = minI(lineLength, sizeof(handleBuffer) - 1);
|
||||||
|
@ -543,8 +545,7 @@ void handleConsoleLine(char *line) {
|
||||||
return; // error detected
|
return; // error detected
|
||||||
|
|
||||||
int lineLength = strlen(line);
|
int lineLength = strlen(line);
|
||||||
if (lineLength > 100) {
|
if (lineLength > MAX_CMD_LINE_LENGTH) {
|
||||||
// todo: better max size logic
|
|
||||||
// todo: better reaction to excessive line
|
// todo: better reaction to excessive line
|
||||||
efiPrintf("Long line?");
|
efiPrintf("Long line?");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue