use sizeof() instead of hard-coded UUID length in newSubscriber()
This commit is contained in:
parent
24d54ba13a
commit
5fd754c4e2
|
@ -112,7 +112,7 @@ newSubscriber(const char * eventurl, const char * callback, int callbacklen)
|
|||
/* TODO: improve that */
|
||||
strncpy(tmp->uuid, uuidvalue_igd, sizeof(tmp->uuid));
|
||||
tmp->uuid[sizeof(tmp->uuid)-1] = '\0';
|
||||
snprintf(tmp->uuid+37, 5, "%04lx", random() & 0xffff);
|
||||
snprintf(tmp->uuid+sizeof(tmp->uuid)-5, 5, "%04lx", random() & 0xffff);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue