Commit 61a5da33 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Using strdup.

parent 94814581
......@@ -6,9 +6,7 @@ PrrtReceiver *PrrtReceiver_create(const char *host, uint16_t port)
{
PrrtReceiver *recv = calloc(1, sizeof(PrrtReceiver));
check_mem(recv);
uint32_t hostLength = (uint32_t) strlen(host);
recv->host_name = calloc(1, hostLength + 1);
memcpy((void *) recv->host_name, host, hostLength);
recv->host_name = strdup(host);
recv->port = port;
return recv;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment