From c309d1643fc56d3d060a6051f59eec6f738a105b Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 20 Dec 2012 14:01:24 +0100 Subject: [PATCH] better strerror() for windows usb issues --- ykcore/ykcore_windows.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ykcore/ykcore_windows.c b/ykcore/ykcore_windows.c index c82ae85..d91ef45 100644 --- a/ykcore/ykcore_windows.c +++ b/ykcore/ykcore_windows.c @@ -182,5 +182,8 @@ int _ykusb_write(void *dev, int report_type, int report_number, const char *_ykusb_strerror(void) { - return "USB error\n"; + static char buf[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, + buf, sizeof(buf), NULL); + return buf; } -- 2.39.5