From 1275a789b75daef0673dbc885b3a7c62b0155bb8 Mon Sep 17 00:00:00 2001 From: xiangfu Date: Tue, 28 Apr 2009 17:22:07 +0000 Subject: [PATCH] command_input return 0 means correct --- flash-tool/command_line.c | 2 +- flash-tool/main.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flash-tool/command_line.c b/flash-tool/command_line.c index 9d4f95b..4b8d15a 100644 --- a/flash-tool/command_line.c +++ b/flash-tool/command_line.c @@ -130,7 +130,7 @@ int handle_boot(void) int command_input(char *buf) { char *cptr; - cptr = fgets(buf, ARRAY_SIZE(buf), stdin); + cptr = fgets(buf, 256, stdin); if (cptr != NULL) return 0; diff --git a/flash-tool/main.c b/flash-tool/main.c index 7fd9e20..a7c59f6 100644 --- a/flash-tool/main.c +++ b/flash-tool/main.c @@ -88,7 +88,8 @@ int main(int argc, char **argv) while (1) { printf("\n inflash :> "); - if (!command_input(com_buf)) continue; + if (command_input(com_buf)) + continue; command_handle(com_buf); }