summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-17 14:55:12 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-17 14:55:12 +0000
commite873a6d27cc1b0323b5687f6aecb1ee3c513688c (patch)
treedcbc60fe2229361816d425b679fdfd34c86a8a0a
parent3160f4a48d2eb26e1edcde3af3b3f12aa3b9d025 (diff)
downloadopenocd+libswd-e873a6d27cc1b0323b5687f6aecb1ee3c513688c.tar.gz
openocd+libswd-e873a6d27cc1b0323b5687f6aecb1ee3c513688c.tar.bz2
openocd+libswd-e873a6d27cc1b0323b5687f6aecb1ee3c513688c.tar.xz
openocd+libswd-e873a6d27cc1b0323b5687f6aecb1ee3c513688c.zip
check syntax for init/version
git-svn-id: svn://svn.berlios.de/openocd/trunk@1257 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/zy1000.c2
-rw-r--r--src/openocd.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/jtag/zy1000.c b/src/jtag/zy1000.c
index e74478a6..0b3c8525 100644
--- a/src/jtag/zy1000.c
+++ b/src/jtag/zy1000.c
@@ -355,7 +355,7 @@ int zy1000_register_commands(struct command_context_s *cmd_ctx)
int zy1000_init(void)
{
- LOG_ERROR("%s\n", ZYLIN_OPENOCD_VERSION);
+ LOG_USER("%s", ZYLIN_OPENOCD_VERSION);
ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x30); // Turn on LED1 & LED2
diff --git a/src/openocd.c b/src/openocd.c
index 471a097a..e46f62d2 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -82,6 +82,9 @@ void print_version(void)
/* Give TELNET a way to find out what version this is */
int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
+ if (argc!=0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
command_print(cmd_ctx, OPENOCD_VERSION);
return ERROR_OK;
@@ -123,6 +126,10 @@ int ioutil_init(struct command_context_s *cmd_ctx);
/* OpenOCD can't really handle failure of this command. Patches welcome! :-) */
int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
+
+ if (argc!=0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
int retval;
static int initialized=0;
if (initialized)