summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82fef7e)
raw | patch | inline | side by side (parent: 82fef7e)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 4 Jul 2007 01:29:24 +0000 (01:29 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 4 Jul 2007 01:29:24 +0000 (01:29 +0000) |
src/extract-uri.cpp | patch | blob | history |
diff --git a/src/extract-uri.cpp b/src/extract-uri.cpp
index 0461f1101caa845aa90fa19f7ece885a89ee745b..b3923ed1e4dd64df75961b57e8c6b6affff7b627 100644 (file)
--- a/src/extract-uri.cpp
+++ b/src/extract-uri.cpp
// http://www.w3.org/TR/CSS21/syndata.html#uri
gchar *extract_uri(gchar const *s)
{
- gchar* result = 0;
+ if (!s)
+ return NULL;
+
+ gchar* result = NULL;
gchar const *sb = s;
- g_assert( strncmp(sb, "url", 3) == 0 );
+ if ( strlen(sb) < 4 || strncmp(sb, "url", 3) != 0 ) {
+ return NULL;
+ }
+
sb += 3;
// This first whitespace technically is not allowed.