aboutsummaryrefslogtreecommitdiff
path: root/src/pld/virtex2.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-10-24 01:22:58 -0700
committerZachary T Welch <zw@superlucidity.net>2009-11-05 18:03:19 -0800
commit6e542407e7927ec589824b56ba706ed02d0ba97f (patch)
tree1026b225c45a0038085a804d9306a5b6b5ef0bd8 /src/pld/virtex2.c
parent2b78a4e82b1845ee7cc89f6e31d7b49e9299cb32 (diff)
downloadriscv-openocd-6e542407e7927ec589824b56ba706ed02d0ba97f.zip
riscv-openocd-6e542407e7927ec589824b56ba706ed02d0ba97f.tar.gz
riscv-openocd-6e542407e7927ec589824b56ba706ed02d0ba97f.tar.bz2
Improve pld command argument parsing.
Diffstat (limited to 'src/pld/virtex2.c')
-rw-r--r--src/pld/virtex2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c
index 831503a..28cae6c 100644
--- a/src/pld/virtex2.c
+++ b/src/pld/virtex2.c
@@ -202,7 +202,9 @@ static int virtex2_handle_read_stat_command(struct command_context_s *cmd_ctx,
return ERROR_OK;
}
- device = get_pld_device_by_num(strtoul(args[0], NULL, 0));
+ unsigned dev_id;
+ COMMAND_PARSE_NUMBER(uint, args[0], dev_id);
+ device = get_pld_device_by_num(dev_id);
if (!device)
{
command_print(cmd_ctx, "pld device '#%s' is out of bounds", args[0]);