summaryrefslogtreecommitdiff
path: root/src/pld/virtex2.c
diff options
context:
space:
mode:
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 831503a5..28cae6ca 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]);