On 27/06/13 16:15, Hans de Goede wrote:
Hi,
On 06/27/2013 03:49 PM, Toby Gray wrote:
This is a slightly reworked version of my previous logging patches.
I've improved the commit message for the first patch and made the
changes suggested by Hans de Goede relating to return value of
snprintf calls.
Thanks, I've pushed the 1st patch, as it is indeed very useful
for debugging multi-threaded apps. So it will be in 1.0.16rc2
which I plan to release after I get some feedback from Xiaofan
on the openbsd crash.
Excellent. I've just discovered that it triggers a build warning. I've
attached a fix for this build warning.
For the 2nd patch lets wait for Pete's comments.
Agreed.
Regards,
Toby
>From 60ce7c013a99b054337db0407731840a0b6c8b2a Mon Sep 17 00:00:00 2001
From: Toby Gray <toby.g...@realvnc.com>
Date: Thu, 27 Jun 2013 16:47:46 +0100
Subject: [PATCH] Core: Fix warning in use of fprintf.
Some versions of GCC can check that format strings are being used
securely. This commit fixes the following warning:
core.c:2023:2: warning: format not a string literal and no format arguments [-Wformat-security]
---
libusb/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libusb/core.c b/libusb/core.c
index 53f716f..ec37ba1 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -2020,7 +2020,7 @@ int usbi_gettimeofday(struct timeval *tp, void *tzp)
static void usbi_log_str(struct libusb_context *ctx, const char * str)
{
UNUSED(ctx);
- fprintf(stderr, str);
+ fprintf(stderr, "%s", str);
}
void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel