Invalid command syntax errors with MWW.

This fixes an issue due to the new command handler syntax caused by the mw handler playing with the args pointer before
using the CMD_NAME macro.  Fix is to move this call above the lines changing args.
__archive__
Dean Glazeski 2009-11-14 12:39:08 -06:00 committed by Zachary T Welch
parent 4088b1e622
commit c93ae60bce
1 changed files with 2 additions and 1 deletions

View File

@ -2308,6 +2308,7 @@ COMMAND_HANDLER(handle_mw_command)
bool physical=strcmp(args[0], "phys")==0;
int (*fn)(struct target *target,
uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
const char *cmd_name = CMD_NAME;
if (physical)
{
argc--;
@ -2333,7 +2334,7 @@ COMMAND_HANDLER(handle_mw_command)
struct target *target = get_current_target(cmd_ctx);
unsigned wordsize;
uint8_t value_buf[4];
switch (CMD_NAME[2])
switch (cmd_name[6])
{
case 'w':
wordsize = 4;