Created
September 27, 2010 21:59
-
-
Save njh/599957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/raptor_uri.c b/src/raptor_uri.c | |
index f147bb9..cda374d 100644 | |
--- a/src/raptor_uri.c | |
+++ b/src/raptor_uri.c | |
@@ -466,8 +466,11 @@ raptor_uri_compare(raptor_uri* uri1, raptor_uri* uri2) | |
if(uri1 == uri2) | |
return 0; | |
- if(uri1 && uri2) | |
- return strcmp((const char*)uri1->string, (const char*)uri2->string); | |
+ if(uri1 && uri2) { | |
+ unsigned int len = (uri1->length > uri2->length) ? | |
+ uri1->length : uri2->length; | |
+ return strncmp((const char*)uri1->string, (const char*)uri2->string, len); | |
+ } | |
/* One arg is NULL - sort that first */ | |
return (!uri1) ? -1 : 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment