Hi Joerg,

Attached is a patch from Nobuhiro Iwamatsu to fix a compiler error in
usb_dev_handle.

Cheers,
Shaun

---------- Forwarded message ----------
From: Nobuhiro Iwamatsu <iwama...@nigauri.org>
Date: 2010/1/22
Subject: Bug#565280: FTBFS: jtag2usb.cc:98: error: invalid conversion
from 'const  char*' to 'char*'
To: 565...@bugs.debian.org


tags 565280 patch
thanks

I made the patch which revised this problem.
And I checked build and the installation of the package.
But I do not have environment working this.
Sorry.

Best regards,
 Nobuhiro

--
Nobuhiro Iwamatsu
 iwamatsu at {nigauri.org / debian.org}
 GPG ID: 40AD1FA6
diff --git a/src/jtag2usb.cc b/src/jtag2usb.cc
index 5981e57..43329dd 100644
--- a/src/jtag2usb.cc
+++ b/src/jtag2usb.cc
@@ -40,6 +40,7 @@
 #include <signal.h>
 #include <string.h>
 #include <errno.h>
+#include <assert.h>
 
 #include <usb.h>
 
@@ -71,6 +72,7 @@ static usb_dev_handle *opendev(const char *jtagDeviceName, emulator emu_type,
   struct usb_device *dev;
   usb_dev_handle *udev;
   char *serno, *cp2;
+  char *s;
   u_int16_t pid;
   size_t x;
 
@@ -95,7 +97,9 @@ static usb_dev_handle *opendev(const char *jtagDeviceName, emulator emu_type,
    * right-to-left, so only the least significant nibbles need to be
    * specified.
    */
-  if ((serno = strchr(jtagDeviceName, ':')) != NULL)
+  s = strdup(jtagDeviceName);
+  assert(s !=  NULL);
+  if ((serno = strchr(s, ':')) != NULL)
     {
       /* first, drop all colons there if any */
       cp2 = ++serno;
@@ -109,6 +113,7 @@ static usb_dev_handle *opendev(const char *jtagDeviceName, emulator emu_type,
 
       unixCheck(strlen(serno) <= 12, "invalid serial number \"%s\"", serno);
     }
+  free(s);
 
   usb_init();
 

Reply via email to