File tree 4 files changed +4
-3
lines changed 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ namespace Aws
24
24
namespace Utils
25
25
{
26
26
static const size_t UUID_BINARY_SIZE = 0x10 ;
27
+ static const size_t UUID_STR_SIZE = 0x24 ;
27
28
28
29
/* *
29
30
* Class encapsulating a UUID. This is platform dependent. The method you are most likely interested in is RandomUUID().
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ namespace Aws
21
21
{
22
22
UUID UUID::RandomUUID ()
23
23
{
24
- char uuid[UUID_BINARY_SIZE ];
24
+ char uuid[UUID_STR_SIZE ];
25
25
memset (uuid, 0 , sizeof (uuid));
26
26
27
27
int fd = fopen (" /proc/sys/kernel/random/uuid" , " r" );
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ namespace Aws
25
25
::UUID uuidStruct;
26
26
UuidCreate (&uuidStruct);
27
27
28
- unsigned char newUuid[16 ];
28
+ unsigned char newUuid[UUID_BINARY_SIZE ];
29
29
memcpy (newUuid, &uuidStruct.Data1 , sizeof (uuidStruct.Data1 ));
30
30
memcpy (newUuid + 4 , &uuidStruct.Data2 , sizeof (uuidStruct.Data2 ));
31
31
memcpy (newUuid + 6 , &uuidStruct.Data3 , sizeof (uuidStruct.Data3 ));
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ namespace Aws
34
34
UUID::UUID (const Aws::String& uuidToConvert)
35
35
{
36
36
// GUID has 2 characters per byte + 4 dashes = 36 bytes
37
- assert (uuidToConvert.length () == UUID_BINARY_SIZE * 2 + 4 );
37
+ assert (uuidToConvert.length () == UUID_STR_SIZE );
38
38
memset (m_uuid, 0 , sizeof (m_uuid));
39
39
Aws::String escapedHexStr (uuidToConvert);
40
40
StringUtils::Replace (escapedHexStr, " -" , " " );
You can’t perform that action at this time.
0 commit comments