Assert uuid argument isn't NULL
This commit is contained in:
parent
3689c17d09
commit
be30189d15
@ -4,6 +4,7 @@
|
||||
#include "../prng/xorshift/xorshift.h"
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define UUID_STR_FORMAT ("%.8" PRIx64 "-%.4" PRIx64 "-%.4" PRIx64 "-%.4" PRIx64 "-%.12" PRIx64)
|
||||
|
||||
@ -17,15 +18,12 @@ internal UUID4 generate_uuid4(void);
|
||||
internal void uuid4_to_uuid(const UUID4* uuid4, UUID *uuid);
|
||||
|
||||
UUID *wapp_uuid_init_uuid4(UUID *uuid) {
|
||||
if (!uuid) {
|
||||
goto RETURN_INIT_UUID4;
|
||||
}
|
||||
assert(uuid != NULL && "uuid argument shouldn't be NULL");
|
||||
|
||||
UUID4 uuid4 = generate_uuid4();
|
||||
uuid4_to_uuid(&uuid4, uuid);
|
||||
|
||||
RETURN_INIT_UUID4:
|
||||
return uuid;
|
||||
return uuid;
|
||||
}
|
||||
|
||||
internal UUID4 generate_uuid4(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user