mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-25 12:04:47 +00:00
Fix for new mg_iobuf API
This commit is contained in:
1 parent
bd7ee0d1e8
commit
70683fc8e7
4 files changed
+10
-4
No files matched your search
@@ -44,12 +44,12 @@ static void cli_rm(const char *fname) {
|
||||
remove(path);
|
||||
}
|
||||
|
||||
void cli(uint8_t input_byte) {
|
||||
static struct mg_iobuf in;
|
||||
static struct mg_iobuf in;
|
||||
|
||||
void cli(uint8_t input_byte) {
|
||||
if (input_byte == 0 || input_byte == 0xff) return;
|
||||
if (in.len >= 128) in.len = 0;
|
||||
mg_iobuf_add(&in, in.len, &input_byte, sizeof(input_byte), 32);
|
||||
mg_iobuf_add(&in, in.len, &input_byte, sizeof(input_byte));
|
||||
|
||||
if (input_byte == '\n') {
|
||||
const char *arrow = "---";
|
||||
@@ -87,3 +87,7 @@ void cli(uint8_t input_byte) {
|
||||
in.len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void cli_init(void) {
|
||||
mg_iobuf_init(&in, 0, 32);
|
||||
}
|
||||
Reference in new issue
Block a user