Fix const-ness of strrchr callers.
This causes build failures in google3 where they use GCC. glibc only
provides const-correct overloads for string functions for GCC >= 4.4,
but clang -- which is what we use -- pretends to be GCC 4.2.
Change-Id: I2a054823ea6201ebcea46d5e77b80a975eefc622
diff --git a/adb/usb_linux.cpp b/adb/usb_linux.cpp
index e570ef5..dd22712 100644
--- a/adb/usb_linux.cpp
+++ b/adb/usb_linux.cpp
@@ -264,14 +264,12 @@
// Determine the device path
if (!fstat(fd, &st) && S_ISCHR(st.st_mode)) {
- char *slash;
- ssize_t link_len;
snprintf(pathbuf, sizeof(pathbuf), "/sys/dev/char/%d:%d",
major(st.st_rdev), minor(st.st_rdev));
- link_len = readlink(pathbuf, link, sizeof(link) - 1);
+ ssize_t link_len = readlink(pathbuf, link, sizeof(link) - 1);
if (link_len > 0) {
link[link_len] = '\0';
- slash = strrchr(link, '/');
+ const char* slash = strrchr(link, '/');
if (slash) {
snprintf(pathbuf, sizeof(pathbuf),
"usb:%s", slash + 1);