summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 21:55:53 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 21:55:53 +0100
commit213baa59e3644093f5b208218e8d233d95fd4a74 (patch)
tree6ded879d196cc1d7d30f0c24f3adc84d9796b366 /src
parenta87b60337712543a6f715b45c80affbdc5ba520a (diff)
downloadxine-lib-213baa59e3644093f5b208218e8d233d95fd4a74.tar.gz
xine-lib-213baa59e3644093f5b208218e8d233d95fd4a74.tar.bz2
Use strndup.
Diffstat (limited to 'src')
-rw-r--r--src/input/librtsp/rtsp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c
index b6dad6a31..d0f09d563 100644
--- a/src/input/librtsp/rtsp.c
+++ b/src/input/librtsp/rtsp.c
@@ -473,9 +473,7 @@ rtsp_t *rtsp_connect(xine_stream_t *stream, const char *mrl, const char *user_ag
pathbegin=slash-mrl_ptr;
hostend=colon-mrl_ptr;
- s->host = malloc(sizeof(char)*hostend+1);
- strncpy(s->host, mrl_ptr, hostend);
- s->host[hostend]=0;
+ s->host = strndup(mrl_ptr, hostend);
if (pathbegin < strlen(mrl_ptr)) s->path=strdup(mrl_ptr+pathbegin+1);
if (colon != slash) {