diff options
-rw-r--r-- | libyelp/yelp-uri-builder.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libyelp/yelp-uri-builder.c b/libyelp/yelp-uri-builder.c index bb34d202..58a53ac9 100644 --- a/libyelp/yelp-uri-builder.c +++ b/libyelp/yelp-uri-builder.c @@ -78,9 +78,10 @@ build_yelp_uri (const gchar *uri_str) memmove (uri, uri + BOGUS_PREFIX_LEN, strlen (uri) - BOGUS_PREFIX_LEN + 1); /* Remove the leading slash */ - resource = strstr (uri, ":"); - resource++; - memmove (resource, resource + 1, strlen (resource)); + if ((resource = strstr (uri, ":"))) { + resource++; + memmove (resource, resource + 1, strlen (resource)); + } /* Remove the trailing slash if any */ path_len = strlen (uri); |