[PATCH BlueZ] tools/hex2hcd: fix musl compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The call to basename() relies on a GNU extension
to take a const char * vs a char *. Let's define
a trivial helper function to ensure compatibility
with musl.

Downstream gentoo bug: https://bugs.gentoo.org/926344
Fixes: #843
---
 tools/hex2hcd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c
index 42c95b759..28f0e8be2 100644
--- a/tools/hex2hcd.c
+++ b/tools/hex2hcd.c
@@ -285,9 +285,11 @@ static void ver_parse_file(const char *pathname)
 	prev->next = ver;
 }
 
-static const char *helper_basename(const char *path) {
-  const char *base = strrchr(path, '/');
-  return base ? base + 1 : path;
+static const char *helper_basename(const char *path)
+{
+	const char *base = strrchr(path, '/');
+
+	return base ? base + 1 : path;
 }
 
 static void ver_parse_entry(const char *pathname)
-- 
2.45.2







[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux