X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fpld%2Fvirtex2.c;h=ec0847fe3e6245e383ee6794edfa87850748a8d2;hp=831503a56b6b15065ce8f048fb6e59e5da958fd1;hb=ca594adb5a71f2bf60c1380172b8e61b075d9479;hpb=dc575dc5bf8cb597a0e9a47794744ae6b1928087 diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index 831503a56b..ec0847fe3e 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -143,7 +143,7 @@ static int virtex2_read_stat(struct pld_device_s *pld_device, uint32_t *status) return ERROR_OK; } -static int virtex2_load(struct pld_device_s *pld_device, char *filename) +static int virtex2_load(struct pld_device_s *pld_device, const char *filename) { virtex2_pld_device_t *virtex2_info = pld_device->driver_priv; xilinx_bit_file_t bit_file; @@ -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]);