mirror of
https://github.com/RPCS3/libusb.git
synced 2026-01-31 01:25:19 +01:00
examples: xusb: replaced insecure sprintf with snprintf
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
committed by
Chris Dickens
parent
830a9cb27d
commit
f66c63e9f0
@@ -183,7 +183,8 @@ static char* uuid_to_string(const uint8_t* uuid)
|
||||
{
|
||||
static char uuid_string[40];
|
||||
if (uuid == NULL) return NULL;
|
||||
sprintf(uuid_string, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
snprintf(uuid_string, sizeof(uuid_string),
|
||||
"{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
|
||||
uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);
|
||||
return uuid_string;
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 11235
|
||||
#define LIBUSB_NANO 11236
|
||||
|
||||
Reference in New Issue
Block a user