changeset 4653:d2a7fcfeec6f

Removed the url_copy function , since it was badly implemented, and a url_new can do the job.
author bertrand
date Mon, 11 Feb 2002 05:19:11 +0000
parents 17cf55182029
children 227365bd93c7
files libmpdemux/url.c libmpdemux/url.h
diffstat 2 files changed, 2 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/url.c	Mon Feb 11 05:16:09 2002 +0000
+++ b/libmpdemux/url.c	Mon Feb 11 05:19:11 2002 +0000
@@ -19,6 +19,8 @@
 	URL_t* Curl;
 	char *ptr1, *ptr2, *ptr3;
 
+	if( url==NULL ) return NULL;
+	
 	// Create the URL container
 	Curl = (URL_t*)malloc(sizeof(URL_t));
 	if( Curl==NULL ) {
@@ -105,22 +107,6 @@
 	return Curl;
 }
 
-URL_t *
-url_copy(URL_t* url) {
-	URL_t *dup_url;
-
-	if( url==NULL ) return NULL;
-	dup_url = (URL_t*)malloc(sizeof(URL_t));
-	if( dup_url==NULL ) {
-		printf("Memory allocation failed!\n");
-		return NULL;
-	}
-	memcpy( dup_url, url, sizeof(URL_t) );
-	
-	return dup_url;
-}
-
-
 void
 url_free(URL_t* url) {
 	if(!url) return;
--- a/libmpdemux/url.h	Mon Feb 11 05:16:09 2002 +0000
+++ b/libmpdemux/url.h	Mon Feb 11 05:19:11 2002 +0000
@@ -20,7 +20,6 @@
 } URL_t;
 
 URL_t* url_new(char* url);
-URL_t* url_copy(URL_t* url);
 void   url_free(URL_t* url);
 
 void url_unescape_string(char *outbuf, char *inbuf);