From 153c5da267180dfb67e05be584a955028aa1fa7b Mon Sep 17 00:00:00 2001 From: mvp Date: Thu, 12 Sep 2024 10:42:23 -0700 Subject: [PATCH] Fixed snprintf override which breaks on old MacOS `snprintf` is available in Mac/FreeBSD headers only if _XOPEN_SOURCE is 600 or higher. This closes #586. --- uhubctl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/uhubctl.c b/uhubctl.c index 85430eb..bd615b7 100644 --- a/uhubctl.c +++ b/uhubctl.c @@ -9,7 +9,7 @@ * */ -#define _XOPEN_SOURCE 500 +#define _XOPEN_SOURCE 600 #include #include @@ -35,10 +35,6 @@ #include #endif -#if defined(__APPLE__) || defined(__FreeBSD__) /* snprintf is not available in pure C mode */ -int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4); -#endif - #if !defined(LIBUSB_API_VERSION) || (LIBUSB_API_VERSION <= 0x01000103) #define LIBUSB_DT_SUPERSPEED_HUB 0x2a #endif