# HG changeset patch # User Richard Laager # Date 1138905869 0 # Node ID ef1b5208bda9d9dc1f2462da2f68d2d5f3e3c884 # Parent 5a7c4570d768a1e08c34da5303d68d5c42e2bfbc [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 diff -r 5a7c4570d768 -r ef1b5208bda9 src/upnp.c --- 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{