updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / avarice / jtag2usb.patch
blob27b31215aeb1d10aeaa1ff7ad4cde93d5807e095
1 --- src/jtag2usb.cc 2007/02/17 22:41:46 1.9
2 +++ src/jtag2usb.cc 2009/06/25 09:29:21 1.10
3 @@ -18,7 +18,7 @@
4 * This file implements the libusb-based USB connection to a JTAG ICE
5 * mkII.
7 - * $Id: jtag2usb.cc,v 1.9 2007/02/17 22:41:46 joerg_wunsch Exp $
8 + * $Id: jtag2usb.cc,v 1.10 2009/06/25 09:29:21 joerg_wunsch Exp $
9 */
12 @@ -70,7 +70,7 @@
13 struct usb_bus *bus;
14 struct usb_device *dev;
15 usb_dev_handle *udev;
16 - char *serno, *cp2;
17 + char *devnamecopy, *serno, *cp2;
18 u_int16_t pid;
19 size_t x;
21 @@ -85,6 +85,9 @@
22 break;
25 + devnamecopy = new char[x = strlen(jtagDeviceName) + 1];
26 + memcpy(devnamecopy, jtagDeviceName, x);
29 * The syntax for usb devices is defined as:
31 @@ -95,7 +98,7 @@
32 * right-to-left, so only the least significant nibbles need to be
33 * specified.
35 - if ((serno = strchr(jtagDeviceName, ':')) != NULL)
36 + if ((serno = strchr(devnamecopy, ':')) != NULL)
38 /* first, drop all colons there if any */
39 cp2 = ++serno;
40 @@ -159,6 +162,8 @@
45 + delete devnamecopy;
46 if (!found)
48 printf("did not find any%s USB device \"%s\"\n",