1.1 --- a/src/platform_unix.c Wed Oct 19 08:34:23 2016 +0200
1.2 +++ b/src/platform_unix.c Wed Oct 19 18:36:05 2016 +0200
1.3 @@ -117,15 +117,17 @@
1.4 return buffer;
1.5 }
1.6
1.7 -// TODO: Check and possibly fix this function if necessary
1.8 +
1.9 void uuid_generate_random(pEpUUID out)
1.10 {
1.11 uuid_t *uuid;
1.12 uuid_rc_t rc_create;
1.13 -
1.14 + size_t size = sizeof(uuid_string_t);
1.15 + void *_out = out;
1.16 +
1.17 if ((rc_create = uuid_create(&uuid)) != UUID_RC_OK ||
1.18 uuid_make(uuid, UUID_MAKE_V1) != UUID_RC_OK ||
1.19 - uuid_export(uuid, UUID_FMT_BIN, out, NULL) != UUID_RC_OK)
1.20 + uuid_export(uuid, UUID_FMT_BIN, &_out, &size) != UUID_RC_OK)
1.21 {
1.22 memset(out, 0, sizeof(pEpUUID));
1.23 }
1.24 @@ -136,15 +138,17 @@
1.25 }
1.26 }
1.27
1.28 -// TODO: Check and possibly fix this function if necessary
1.29 +
1.30 void uuid_unparse_upper(pEpUUID uu, uuid_string_t out)
1.31 {
1.32 uuid_t *uuid;
1.33 uuid_rc_t rc_create;
1.34 + size_t size = sizeof(uuid_string_t);
1.35 + void *_out = out;
1.36
1.37 if ((rc_create = uuid_create(&uuid)) != UUID_RC_OK ||
1.38 uuid_import(uuid, UUID_FMT_BIN, uu, sizeof(pEpUUID)) != UUID_RC_OK ||
1.39 - uuid_export(uuid, UUID_FMT_STR, out, NULL) != UUID_RC_OK)
1.40 + uuid_export(uuid, UUID_FMT_STR, &_out, &size) != UUID_RC_OK)
1.41 {
1.42 memset(out, 0, sizeof(uuid_string_t));
1.43 }