summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2010-12-18 00:32:22 +0100
committerportix <portix@gmx.net>2010-12-18 00:32:22 +0100
commitc8cf2346c427a5d15d197c33835398bf951bd340 (patch)
treea4d896bff6bcad8048fabd30065cba09e53cad6d /src/util.c
parenta318a01a751301a4bd1b9def81482c9166128d9d (diff)
downloaddwb-c8cf2346c427a5d15d197c33835398bf951bd340.zip
allow plugins for specific domains
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util.c b/src/util.c
index e38e9186..1edcc182 100644
--- a/src/util.c
+++ b/src/util.c
@@ -429,16 +429,16 @@ dwb_malloc(size_t size) {
void
dwb_free(void *p) {
if (p)
- free(p);
+ g_free(p);
}
-/* dwb_util_domain_from_uri (char *uri) return: char* (alloc){{{*/
+/* dwb_util_domain_from_uri (char *uri) return: char* {{{*/
char *
-dwb_util_domain_from_uri(char *uri) {
+dwb_util_domain_from_uri(const char *uri) {
if (!uri)
return NULL;
- char *uri_p = g_strdup(uri);
+ char *uri_p = (char*)uri;
char *p = NULL;
char domain[STRING_LENGTH] = { 0 };
@@ -448,7 +448,7 @@ dwb_util_domain_from_uri(char *uri) {
if ( (p = strchr(uri_p, '/')) ) {
strncpy(domain, uri_p, p - uri_p);
}
- char *ret = domain[0] ? g_strdup(domain) : g_strdup(uri_p);
+ char *ret = domain[0] ? domain : uri_p;
return ret;
}/*}}}*/