use sizeof() instead of hard-coded UUID length in newSubscriber()

This commit is contained in:
Daniel Becker 2015-12-11 16:21:32 -08:00
parent 24d54ba13a
commit 5fd754c4e2
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}