Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
PRRT
Commits
61a5da33
Commit
61a5da33
authored
Mar 09, 2016
by
Andreas Schmidt
Browse files
Using strdup.
parent
94814581
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/prrt/receiver.c
View file @
61a5da33
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment