Fix the HAVE_UUID_CREATE code now that its gets used:
- fix temp declaration - use snprintf instread of strcpy()
This commit is contained in:
parent
f046325ef3
commit
17de6442e2
@ -107,19 +107,18 @@ SmsGenerateClientID(SmsConn smsConn)
|
||||
{
|
||||
#if defined(HAVE_UUID_CREATE)
|
||||
char *id;
|
||||
char **temp;
|
||||
char *temp;
|
||||
uuid_t uuid;
|
||||
uint32_t status;
|
||||
size_t len;
|
||||
|
||||
uuid_create(&uuid, &status);
|
||||
|
||||
uuid_to_string(&uuid, &temp, &status);
|
||||
|
||||
if ((id = malloc (strlen (temp) + 2)) != NULL)
|
||||
{
|
||||
id[0] = '2';
|
||||
strcpy (id+1, temp);
|
||||
}
|
||||
len = strlen(temp) + 2;
|
||||
if ((id = malloc(len)) != NULL)
|
||||
snprintf(id, len, "2%s", temp);
|
||||
|
||||
free(temp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user