changeset 13096:ef1b5208bda9

[gaim-migrate @ 15458] Use gaim_str_has_prefix() to cleanup some code. I noticed the hardcoding of SIZEOF_HTTP and that seemed wrong. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 02 Feb 2006 18:44:29 +0000
parents 5a7c4570d768
children f1bf8989bbf2
files src/upnp.c
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/upnp.c	Thu Feb 02 18:42:28 2006 +0000
+++ b/src/upnp.c	Thu Feb 02 18:44:29 2006 +0000
@@ -39,7 +39,6 @@
 ****************************************************************/
 #define HTTP_OK "200 OK"
 #define DEFAULT_HTTP_PORT 80
-#define SIZEOF_HTTP 7         /* size of "http://" string */
 #define DISCOVERY_TIMEOUT 1000
 
 /***************************************************************
@@ -329,10 +328,8 @@
 		return NULL;
 	}
 
-	if(g_strstr_len(xmlnode_get_data(controlURLNode),
-			SIZEOF_HTTP, "http://") == NULL &&
-			g_strstr_len(xmlnode_get_data(controlURLNode),
-				SIZEOF_HTTP, "HTTP://") == NULL) {
+	if(!gaim_str_has_prefix(xmlnode_get_data(controlURLNode), "http://") &&
+	   !gaim_str_has_prefix(xmlnode_get_data(controlURLNode), "HTTP://")) {
 		controlURL = g_strdup_printf("%s%s", baseURL,
 			xmlnode_get_data(controlURLNode));
 	}else{