Skip to content

Commit aa39419

Browse files
Added new constants.
1 parent 1dd6c63 commit aa39419

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

aws-cpp-sdk-core/include/aws/core/utils/UUID.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ namespace Aws
2424
namespace Utils
2525
{
2626
static const size_t UUID_BINARY_SIZE = 0x10;
27+
static const size_t UUID_STR_SIZE = 0x24;
2728

2829
/**
2930
* Class encapsulating a UUID. This is platform dependent. The method you are most likely interested in is RandomUUID().

aws-cpp-sdk-core/source/platform/android/UUID_Impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Aws
2121
{
2222
UUID UUID::RandomUUID()
2323
{
24-
char uuid[UUID_BINARY_SIZE];
24+
char uuid[UUID_STR_SIZE];
2525
memset(uuid, 0, sizeof(uuid));
2626

2727
int fd = fopen("/proc/sys/kernel/random/uuid", "r");

aws-cpp-sdk-core/source/platform/windows/UUID_Impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Aws
2525
::UUID uuidStruct;
2626
UuidCreate(&uuidStruct);
2727

28-
unsigned char newUuid[16];
28+
unsigned char newUuid[UUID_BINARY_SIZE];
2929
memcpy(newUuid, &uuidStruct.Data1, sizeof(uuidStruct.Data1));
3030
memcpy(newUuid + 4, &uuidStruct.Data2, sizeof(uuidStruct.Data2));
3131
memcpy(newUuid + 6, &uuidStruct.Data3, sizeof(uuidStruct.Data3));

aws-cpp-sdk-core/source/utils/UUID.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace Aws
3434
UUID::UUID(const Aws::String& uuidToConvert)
3535
{
3636
//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);
3838
memset(m_uuid, 0, sizeof(m_uuid));
3939
Aws::String escapedHexStr(uuidToConvert);
4040
StringUtils::Replace(escapedHexStr, "-", "");

0 commit comments

Comments
 (0)